Ugly python solution


  • 0
    B
    class Solution(object):
        def moveZeroes(self, nums):
            for n in range(0, 2):
                for i in range(0, len(nums)):
                    if(nums[i] == 0):
                        del nums[i]
                        nums.append(0)
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.