Day - 9
Hi, friends. You know, I am doing a challenge. It is the 9th day of my 100 days coding challenge. Today I am going to share a LeetCode solution for you! I know that consistency is key! I love consistent people as well. That kind of person knows how to manage their time. It was just information!
/*
* @param {number[]} nums
* @return {void} Do not return anything,
* modify nums in-place instead.
*/
var moveZeroes = function (nums) {
let j = 0;
for (let i = 0; i < nums.length; i++) {
if (nums[i] !== 0) {
[nums[j], nums[i]] = [nums[i], nums[j]];
j++;
}
}
};
It's all I was going to share. Thanks for your attention! To see you dears!