본문 바로가기

IT/코딩테스트

[Leetcode] 283. Move Zeroes

728x90

https://leetcode.com/problems/move-zeroes/

class Solution:
    def moveZeroes(self, nums: List[int]) -> None:

        count = nums.count(0)

        if count == len(nums):
            return

        for i in range(count):
            nums.remove(0)
            nums.append(0)
728x90