Loading...
Loading...
Loading...
Two branches send their order amounts, each list already sorted from smallest to largest. Merge them into one sorted list.
Example
Input
3 4 1 4 9 2 3 10 12
Output
1 2 3 4 9 10 12
One pass over both lists.
Try the problem first. Open one hint at a time.
Keep one pointer in each list and compare the front items.
When one list runs out, add what is left of the other.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor