移动零
https://www.lintcode.com/problem/539/description?utm_source=sc-libao-ql
输入: nums = [0, 1, 0, 3, 12],输出: [1, 3, 12, 0, 0].输入: nums = [0, 0, 0, 3, 1],输出: [3, 1, 0, 0, 0].```python
from typing import (
List,
)
class Solution:
"""
@param nums: an integer array
@return: nothing
"""
def move_zeroes(self, nums: List[int]):
# write your code here
idx = 0
for i in nums:
if i:
nums[idx] = i
idx += 1
while idx < len(nums):
nums[idx] = 0
idx += 1
```Last updated