Plus One , Array to String , Add +1 and then make Array | JS
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
==== Q===
https://leetcode.com/explore/interview/card/top-interview-questions-easy/92/array/559/
==== Solution ===
/**
* @param {number[]} nums
* @return {void} Do not return anything, modify nums in-place instead.
*/
var moveZeroes = function(nums) {
var left=0; var right=0; var temp;
while(right <=nums.length-1){
// if zero found just increament the right
if(nums[right] === 0){
right++;
}
// if non-zero element found, Swap both values
else{
temp = nums[left];
nums[left]=nums[right];
nums[right]=temp;
left++; right++;
}
}
};