Leetcode in Java && Oracle
421 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-12-09_02-58-54.png
28.4 KB
#N283. Move Zeroes
problem link

#solution
class Solution {
public void moveZeroes(int[] nums) {
int index = 0;

for (int n: nums)
if(n != 0)
nums[index++] = n;

while(index<nums.length)
nums[index++] = 0;

}
}