Merge into the first list
a is a sorted list that has extra zeros at the end: exactly enough room
for all of b, another sorted list. Merge b into a so that a ends
up sorted, without making a new list. Filling from the front would
overwrite values of a not yet placed, so fill from the back: compare the
last real value of a with the last value of b, put the larger in the
last slot, and move inward.
Write merge_into(a, m, b) where m is how many real values a has at
the start, so len(a) is always m + len(b). Modify a in place and
return it.
merge_into([1, 3, 5, 0, 0], 3, [2, 4]) -> [1, 2, 3, 4, 5]
def merge_into(a, m, b):
...