Merge two sorted linked lists in O(N) time.
Asked in the Onsite Round 1 stage.
Implement merge_two_lists(list1, list2), where each argument is the head of a singly linked list sorted in nondecreasing order. Return the head of one merged sorted linked list by reusing the existing nodes. In examples and tests, linked lists are represented as arrays of node values.
def merge_two_lists(list1, list2):