题解 | #移动 0#
移动 0
http://www.nowcoder.com/practice/102586387caa4afcbad6f96affce9780
#啊这啊这,直接遍历,遇到0 remove删除,后在列表尾append
class Solution:
def moveZeroes(self , nums: List[int]) -> List[int]:
# write code here
for i in nums:
if i==0:
nums.remove(i)
nums.append(0)
return nums