10) Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1->2->4, 1->3->4 Output: 1->1->2->3->4->4 Explanation L1 = 1->4 L2 = 2->3 Output = 1->2->3->4 Create a dummy node. ListNode dummy = new ListNode(0); //dummy = … Continue reading 10) Merge Two Sorted Lists