The problem. You are given the heads of two sorted linked lists, list1 and list2. Merge them into one sorted list by splicing their nodes together, and return its head.
Input: list1 = [1, 2, 4], list2 = [1, 3, 4]
Output: [1, 1, 2, 3, 4, 4]
Input: list1 = [], list2 = [0]
Output: [0]Free account
Sign up to read the rest of this lesson: 5 more sections, 2 drawings, a dry-run simulator and code in JavaScript, Python, Java and C++.
Still to come