In-Place Merge Into a Buffered Array
Asked at Amazon · Coding Questions · Difficulty: Easy · Last asked Feb 8, 2026
You are given two lists of integers, each sorted in ascending order. The first list, `arr1`, has `m` real elements followed by `n` spare slots, so its length is `m + n`. The second list, `arr2`, has `n` elements. Merge `arr2` into `arr1` so that `arr1` ends up holding all `m + n` values in ascending order.
Loading the problem…