파이썬은 리스트가 잘 되어 있어서 구현이 쉬웠음
class Solution(object):
def moveZeroes(self, nums):
if len(nums) == 0:
return
for i in range(len(nums)):
if(nums[i] == 0):
nums.remove(0)
nums.append(0)
"""
:type nums: List[int]
:rtype: None Do not return anything, modify nums in-place instead.
"""
'Algorithm > LeetCode 문제 풀이' 카테고리의 다른 글
[Leetcode 492. Construct the Rectangle] Java (0) | 2019.04.02 |
---|---|
[LeetCode 485] python - 예외 처리에 주의하기.. (0) | 2019.04.02 |
[LeetCode 232, 283, 290 - 완료, 485, 492] python (0) | 2019.03.31 |
[LeetCode 542. 01 Matrix] [python] 4. 재귀 함수 (0) | 2019.03.31 |
[LeetCode 232. Implement Queue using Stacks] [python] 3. 스택을 이용하여 큐를 구현하기 (0) | 2019.03.30 |