Loading...
Loading...
Loading...
Two sections of a class each have their marks sorted from low to high. Merge them into one sorted list for the whole class, without calling a sort method.
Example
Input
4 12 35 60 88 3 20 35 95
Output
12 20 35 35 60 88 95
Duplicates such as 35 are kept.
Try the problem first. Open one hint at a time.
Keep one index in each list. Compare the two current marks and copy the smaller one.
When one list runs out, copy the rest of the other list as it is.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor