c++ stl and iterator


  • 0
    D

    class Solution {
    public:
    void moveZeroes(vector<int>& nums) {
    auto it=remove(nums.begin(),nums.end(),0);
    for(;it!=nums.end();it++)
    *it=0;
    }
    };


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.