1、题目
https://leetcode-cn.com/problems/peeking-iterator/
2、题意
题解1:将非0的数放在数组前面 后面的数全部置于0即可
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int j = 0;
for(auto &x:nums)
if(x)
nums[j++] = x;
for(;j<n;j++)
nums[j] = 0;
}
};