Keep two pointers, iterate, and swap as necessary.

```
class Solution(object):
def moveZeroes(self, nums):
i, j = 0, 1
while j < len(nums):
if nums[i] == 0:
if nums[j] != 0:
nums[i], nums[j] = nums[j], nums[i]
i += 1
else:
i += 1
j += 1
```