Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

Note that you must do this in-place without making a copy of the array.

&nbsp;
Example 1:
Input: nums = [0,1,0,3,12]
Output: [1,3,12,0,0]
Example 2:
Input: nums = [0]
Output: [0]

&nbsp;
Constraints:


	1 &lt;= nums.length &lt;= 104
	-231 &lt;= nums[i] &lt;= 231 - 1


&nbsp;
Follow up: Could you minimize the total number of operations done?
class Solution:
    def moveZeroes(self, nums: List[int]) -> None:
        """
        Do not return anything, modify nums in-place instead.

        """
        notzero = 0
        zero = 0

        while notzero < len(nums):
            if nums[notzero] != 0:
                nums[zero] , nums[notzero] = nums[notzero], nums[zero]
                zero += 1
            notzero += 1
class Solution {
    public void moveZeroes(int[] nums) {
       int a = 0, z = 0, temp;
        while(a < nums.length){
            if(nums[a] != 0){
                temp = nums[z];
                nums[z] = nums[a];
                nums[a] = temp; 
                z += 1;
            }
            a += 1;
        }
    }
}
class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int nums_size = nums.size();
        int cntr=0;

        for(int i=0;i<nums_size;i++)
        {
            if(nums[i] != 0)
            {
                nums[cntr] = nums[i];
                cntr++;
            }
        }
        for( int i=cntr;i<nums_size;i++)
        {
            nums[i] = 0;
        }
    }
};
var moveZeroes = function(nums) {
    let lastNonZeroNumber = 0;

    //Moves all the non zero numbers at the start of the array
    for(let i=0; i<nums.length;i++){
       if(nums[i] !=0){
           nums[lastNonZeroNumber] = nums[i];
           lastNonZeroNumber++;
       }
    }

    //Moves all the zeroes replaced from last non zero number found
    //to the end of array
    for(let i = lastNonZeroNumber; i<nums.length;i++){
        nums[i] =0;
    }

};
Move Zeroes