C++ 1 line solution with 93.96% beat rate


  • 0
    S
    class Solution {
    public:
        void moveZeroes(vector<int>& nums) {
            stable_sort(nums.begin(), nums.end(), [](const int& x, const int& y){return (x && !y);});
        }
    };
    

Log in to reply
 

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