We have an array of size m+n in which m elements are present, in sorted order, and a second array of size n, again in sorted order. We want both of them to be sorted and present in the first array. No third array is supposed to be given.
Example:
1, 3, 55, 66, 77, _, _, _
5, 9, 20
The answer would be:
1, 3, 5, 9, 20, 55, 66, 77