Javascript solution


  • 0
    K
        for(var i = 0, n = nums.length; i < n;){
            if(nums[i] === 0) {
                nums.push(nums.splice(i, 1)[0]);
                i = Math.max(i-1, 0);
                n-=1;
            } else {
                i++;
            }
        }
    };
    

Log in to reply
 

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