>_
merge_two_lists.scala
Scala 3.6
Not run yet

+ 8 hidden

Input
list1 = [2, 5, 11]
list2 = [3, 4, 12, 20]
Expected
[2, 3, 4, 5, 11, 12, 20]

At each step the smaller of the two front values goes next: 2, then 3 and 4 from list2, then 5 and 11. Once list1 runs out, the rest of list2 (12, 20) follows as it is.