| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- Protocol
- kaggle
- LeetCode
- 30. Substring with Concatenation of All Words
- attribute
- data science
- 운영체제
- Generator
- 시바견
- DWG
- 715. Range Module
- concurrency
- 파이썬
- Substring with Concatenation of All Words
- Decorator
- Class
- 밴픽
- Convert Sorted List to Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree
- Regular Expression
- Python
- t1
- Python Implementation
- Python Code
- 315. Count of Smaller Numbers After Self
- 프로그래머스
- 컴퓨터의 구조
- 43. Multiply Strings
- iterator
- shiba
Archives
- Today
- Total
Scribbling
LeetCode: 69. Sqrt(x) 본문
class Solution:
def mySqrt(self, x: int) -> int:
ret = 0
l, r = 0, x
while l <= r:
mid = (l + r) // 2
if mid * mid > x:
r = mid - 1
else:
ret = max(ret, mid)
l = mid + 1
return ret'Computer Science > Coding Test' 카테고리의 다른 글
| LeetCode: 72. Edit Distance (0) | 2021.09.26 |
|---|---|
| LeetCode: 71. Simplify Path (0) | 2021.09.26 |
| LeetCode: 67. Add Binary (0) | 2021.09.26 |
| LeetCode: 64. Minimum Path Sum (0) | 2021.09.24 |
| LeetCode: 63. Unique Paths II (0) | 2021.09.24 |