一、问题描述
二、解题思路
先把出现的0删掉,再在数组的后面加0
class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: None Do not return anything, modify nums in-place instead.
"""
for num in nums:
if num==0:
nums.remove(0)
nums.append(0)
return nums