Two Finger Merge
Two Finger Merge
Write merge(left: list[int], right: list[int]) -> list[int], the two-finger merge from merge sort: both lists are already sorted. Keep an index i on left and j on right; while neither has run out, append the smaller of the two values the fingers point at (the left one when they are equal) to merged and move that finger on. When one list is exhausted, the rest of the other follows unchanged, which the slices left[i:] and right[j:] give you. The result is sorted and the merge is O(n). Do NOT write a main block or any top-level test code; the tests construct the calls. Input: two lines, each a space-separated sorted list of integers (either may be empty); the tests print the list your function returns.
Expected Output:
[1, 2, 3, 4, 9, 10, 11]= newline. The output ends with a newline — print one after the last line.
Your Output
Run your code to see the output here...