Solve the merge sorted array problem.