LeetCode Solutions/Algorithm I/Day 3 Two Pointers/Move Zeroes.java
<reponame>DevashishPathrabe/LeetCode<filename>LeetCode Solutions/Algorithm I/Day 3 Two Pointers/Move Zeroes.java<gh_stars>0class Solution {
    public void moveZeroes(int[] nums) {
        int i = 0;
        for(int j=0; j<nums.length; j++){
            if(nums[j] != 0){
                nums[i] = nums[j];
                if(j != i){
                    nums[j] = 0;
                }
                i++;
            }
        }
    }
}