class Solution:
def moveZeroes(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
"""
fast ,slow = 0,0
l_raw = len(nums)
while(fast < len(nums)):
if nums[fast] != 0:#错误1
nums[slow] = nums[fast]
slow += 1
fast +=1
for i in range(slow,l_raw):
nums[i] = 0
return 0
注意:如果要数组赋值,错误的写法是nums = sorted(nums[:slow-1]),而正确的写法是nums[:] = sorted(nums[:slow-1])