Python solution


  • 0
    S
    class Solution(object):
        def moveZeroes(self, nums):
            count_num = 0
      
            while 0 in nums:
                nums.remove(0)
                count_num += 1
            
            for i in range (count_num):
                nums.append(0)
    

Log in to reply
 

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