less than 1 minute read

Given two sorted linked lists node0, and node, return a new sorted linked list containing the union of the two lists.

Constraints

  • 0 ≤ n ≤ 100,000 where n is the number of nodes in node0
  • 0 ≤ m ≤ 100,000 where m is the number of nodes in node1

https://binarysearch.com/problems/Linked-List-Union

Examples

Example 1

Input

  • ll0 =
  • ll1 =

Output

  • answer =

Solution

Leave a comment