Enter your book access code

The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).

Don’t have the book yet? The landing page stays open — purchase unlocks this gym.

intermediate · order 82

Merge sorted slices backward

arr-merge-01Related book chapters: 15 (optional — this page is complete on its own)two-pointermerge

Slug: arr-merge-01 · Paired reading: Chapter 15

Prompt

nums1 has length m + n: first m entries sorted, trailing n zeros are buffer. nums2 is length n, sorted. Merge nums2 into nums1 in-place so nums1 is fully sorted. Fill from the back to avoid clobbering unread values.