Move Zeroes
Given an array nums, move all 0s to the end while keeping the relative order of the non-zero elements. Do it in place and return the same array.
The two-pointer trick: keep a write index; each non-zero element gets written forward, then the tail is filled with zeros.
moveZeroes([0, 1, 0, 3, 12]); // [1, 3, 12, 0, 0]