One Line C++ Solution... Use STL


  • 0
    L
    class Solution {
    public:
    	void moveZeroes(vector<int>& nums) {
    		std::fill(std::remove(nums.begin(), nums.end(), 0), nums.end(), 0);
    	}
    };
    

Log in to reply
 

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