```
if (nums.size() == 0) return;
int zero_count=0;
int index=0;
//Move nonzeros to front
vector<int>::iterator it;
for (it = nums.begin(); it != nums.end(); ++it){
if (!(*it)) zero_count++;
else{
nums[index]=*it;
index++;
}
}
//Append end with zeros
for (int i = index; i < nums.size(); i++){
nums[i]=0;
}
```