Given the heads of two sorted linked lists, merge them into one sorted list by splicing together the nodes.
Example: and merge to .
You're implementing the merge step from merge sort, but with linked lists instead of arrays. The linked list version is simpler because you don't need extra space.
Just repoint the next pointers. Constraints: up to nodes per list, values from to , both lists sorted in non-decreasing order.