Merge Two Sorted Linkedlist

easy
1. Merge two sorted linkedlists and return head of a sorted linkedlist. The list should be made by splicing together the nodes of the first two lists
2. Both list are sorted in increasing order.

Input Format

1->2->6->7->15->24->null -1->0->6->17->25->null

Output Format

-1->0->1->2->6->6->7->15->17->24->25->null

Constraints

0 <= size of linkedlist <= 10^6

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
2
1 5 
4
1 3 6 10 
Output
1 1 3 5 6 10 
Previous
Unfold Of Linkedlist
Next
Mergesort Linkedlist

Related Questions