There are 2 single linked list, one is ascending sorted, the other is descending sorted, write code to merge them together, result in ascending sorted. For example:L1: 1->2->3L2: 6->5->4 Result:1->2->3->4->5->6 Requirements:Time complexity: O(M + N), M is the length of L1, and N is the length of L2Space complexity: O(1) Please write code to solve…