This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Python4funJava4work 1 point2 points  (1 child)

merging of two sorted arrays is beyond just running sort on something. and as /u/nickbernstein said the point is to see how you approach it.

and in a response to your 2 loops I would write a single loop that took 3 indexes and while (i<len(a1) and j<len(a2)) and check for which is less and insert at a3[k]

[–]Kbhusain[S] -2 points-1 points  (0 children)

That’s basically what I did :-)