Merge two sorted arrays without using a third array