Merge two sorted linked lists | Practice | GeeksforGeeks
https://practice.geeksforgeeks.org/problems/merge-two-sorted-linked-lists/1Given two sorted linked lists consisting of N and M nodes respectively.The task is to merge both of the list (in-place) and return head of the merged list. Example 1: Input: N = 4, M = 3 valueN[] = {5,10,15,40} valueM[] = {2,3,20} Output: 2 3 5 10 15 20 40 Explanation: After merging the two linked lists, we have merged list as 2, 3, 5, 10, 15, 20, 40.