| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
Tags
- 알고리즘
- GitLab
- 하늘과 바람과 별과 詩
- ProblemSoving
- Qualification Round
- 해커랭크
- Count Monobit Integers
- First Unique Character in a String
- Algorithm
- leetcode
- 파이썬
- 3D PRINTING
- ProblemSolving
- 프로그래머스
- Code Jam
- MySQL
- C++
- hackerrank
- Python
- Kubernetes
- 하늘과 바람과 별과 시
- LEVEL 2
- 리트코드
- 문제해결
- 코딩테스트
- 2022
- K8S
- Code Jam 2022
- swift
Archives
- Today
- Total
목록Move Zeroes (1)
공대생의 비망록
[LeetCode][Easy] Move Zeroes 문제 Python 풀이
멍청한 풀이: 시간복잡도 O(n^2)class Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ i = len(nums) - 1; j = 0; zeros = 0; moved = 0 while i >= 0: if nums[i] != 0: zeros += 1 i -= 1 else: if zeros == 0: # if there's 0 at the end of th..
Programming Language/Python
2026. 2. 8. 01:13