r/dailyprogrammer • u/oskar_s • May 16 '12
[5/16/2012] Challenge #53 [easy]
Write a function that given two sorted lists, returns a list whith the two lists merged together into one sorted list.
So, for instance, for inputs [1,5,7,8] and [2,3,4,7,9] it should return [1,2,3,4,5,7,7,8,9].
Try and make your code as efficient as possible.
20
Upvotes
View all comments
Show parent comment
1
u/EvanHahn May 18 '12
Why define sort's function? Why not this:
Both of our solutions have the sideffect that
arr1is now sorted.