| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- leetcode
- 하늘과 바람과 별과 시
- 2022
- swift
- 3D PRINTING
- 코딩테스트
- C++
- 문제해결
- Code Jam
- Qualification Round
- Python
- on-prem
- LEVEL 2
- hackerrank
- 하늘과 바람과 별과 詩
- GitLab
- 프로그래머스
- K8S
- 알고리즘
- MySQL
- ingress-nginx
- 해커랭크
- Certbot/dns-route53
- 리트코드
- Code Jam 2022
- ProblemSolving
- Kubernetes
- Algorithm
- 파이썬
Archives
- Today
- Total
목록2026/02/08 (2)
공대생의 비망록
[LeetCode][Easy] Missing Number Python 풀이
이 문제는 보자마자 Python에 익숙한 사람이라면 누구나 쉽게 풀 수 있는 문제라는 생각이 들었다. for-loop을 통해 0부터 n까지 하나씩 확인하는 방법: (시간복잡도 O(n)이나 비효율적인 편)class Solution: def missingNumber(self, nums: List[int]) -> int: for i in range(len(nums) + 1): if i not in nums: return i set을 사용하며 쉽고 빠르게 문제를 해결하는 방법:class Solution: def missingNumber(self, nums: List[int]) -> int: comp = set(range(len(n..
Programming Language/Python
2026. 2. 8. 01:35
[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
