2018.04.01 leetcode 打卡

愚人节啊 ~~

好久不打卡leetcode,懒癌重生~~   一手端着老笨做的意面,一手码着弱智的代码

283Move Zeroes

很是简单的一道题~不在废话

class Solution:
    def moveZeroes(self, nums):
        """
        :type nums: List[int]
        :rtype: void Do not return anything, modify nums in-place instead.
        """
        length = len(nums) - 1 
        for num in (nums):
            if num == 0:
                nums.remove(num)
                nums.append(0)
    

 

你可能感兴趣的:(leetcode,python)