Algorithm · Apple · Easy
You receive the first nodes of two linked lists, list1 and list2, each already arranged in sorted order. Join them into a single linked list that remains sorted, then return its first node. Build the resulting list using the existing nodes from list1 and list2. Examples Example 1: Input: list1 = [2,5,7], list2 = [1,3,8] Output: [1,2,3,5,7,8] Example 2: Input: list1 = [], list2 = [] Output: [] Example 3: Input: list1 = [], list2 = [6] Output: [6] Constraints The total number…
Checking your access…