```
void moveZeroes(vector<int>& nums) {
int sz = nums.size();
int cnt = 0, tail = -1;
for(int i=0; i<sz; i++){
if(nums[i] == 0) continue;
nums[++tail] = nums[i];
cnt++;
}
for(int i=cnt; i<sz; i++) nums[i] = 0;
}
```