classSolution(object):defmoveZeroes(self,nums):""" :type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead. """index_zero=0index_Nzero=0whileindex_Nzero<len(nums)andindex_zero<len(nums):# find zero poswhileindex_zero<len(nums)andnums[index_zero]!=0:index_zero+=1ifindex_zero==len(nums):return# find non-zero pos after zero posindex_Nzero=index_zero+1whileindex_Nzero<len(nums)andnums[index_Nzero]==0:index_Nzero+=1ifindex_Nzero==len(nums):returnnums[index_Nzero],nums[index_zero]=nums[index_zero],nums[index_Nzero]return