loading…
Write move_zeroes(nums) that moves every 0 to the end in place, keeping the order of the other numbers. Return nothing; the test reads the list you were given.
nums = [0, 1, 0, 3, 12]
move_zeroes(nums)
nums -> [1, 3, 12, 0, 0]
Stuck on the idea itself? The two pointers lesson walks through the pattern from scratch.