일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 715. Range Module
- 컴퓨터의 구조
- 43. Multiply Strings
- Convert Sorted List to Binary Search Tree
- data science
- 운영체제
- Python
- 파이썬
- 30. Substring with Concatenation of All Words
- concurrency
- 프로그래머스
- Substring with Concatenation of All Words
- Python Code
- kaggle
- Protocol
- attribute
- Python Implementation
- Generator
- t1
- 시바견
- LeetCode
- 109. Convert Sorted List to Binary Search Tree
- iterator
- DWG
- Decorator
- 315. Count of Smaller Numbers After Self
- 밴픽
- Class
- shiba
- Regular Expression
Archives
- Today
- Total
목록Missing Number (1)
Scribbling
LeetCode: 268. Missing Number
The first solution is using binary search. class Solution: def missingNumber(self, nums: List[int]) -> int: left, right = 0, len(nums) while left < right: mid = (left + right) // 2 cnt = 0 for num in nums: if num int: ret = len(nums) * (len(nums) + 1) // 2 for num in nums: ret -= num return ret
Computer Science/Coding Test
2022. 1. 4. 14:59