class Solution(object):
    def moveZeroes(self, nums):
        """
        :type nums: List[int]
        :rtype: void Do not return anything, modify nums in-place instead.
        """
        j=0
        for i in xrange(len(nums)):
            if nums[j] == 0:
                nums.append(nums.pop(j))

            else:
                j+=1
Copy the code