Created
July 31, 2020 22:10
-
-
Save eklitzke/dc0b8ef8258aa758e5587cda3bdb7551 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
public: | |
void moveZeroes(vector<int>& nums) { | |
auto end = nums.end(); | |
for (auto pos = std::remove(nums.begin(), nums.end(), 0); pos != end; ++pos) { | |
*pos = 0; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment