Python pop and append

  • 0

    My idea is when the current number in the nums list is 0, pop it out and then append it.
    using index() to make sure it pops the current one.

    class Solution(object):
        def moveZeroes(self, nums):
            :type nums: List[int]
            :rtype: void Do not return anything, modify nums in-place instead.
            for i in nums:
                if i == 0:

Log in to reply

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