11. Move Zeroes

Move all 0s to the end of nums in place, keeping the relative order of the non-zero elements. Do not return anything.

Example 1

Input: nums = [4,0,0,5,6]
Output: [4,5,6,0,0]

Example 2

Input: nums = [0]
Output: [0]
Hint 1

Use a “write” pointer for where the next non-zero should go.

Two Pointers