Merge Two Sorted Lists
Given the heads of two sorted linked lists, merge them into one sorted list by splicing the existing nodes together (no new nodes needed for the values). A dummy head node makes the splicing code branch-free.
mergeTwoLists(list(1, 2, 4), list(1, 3, 4)); // 1 -> 1 -> 2 -> 3 -> 4 -> 4