1
slow = 02
for fast in range(len(nums)):3
if nums[fast] != 0:4
if fast != slow:5
nums[fast], nums[slow] = nums[slow], nums[fast]6
slow += 1INIT
slow 记录下一个非零数的位置
0
1
2
3
4
THE VISUAL LIBRARY