일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- concurrency
- 파이썬
- Substring with Concatenation of All Words
- Regular Expression
- Class
- 컴퓨터의 구조
- 시바견
- LeetCode
- iterator
- 밴픽
- 운영체제
- 프로그래머스
- Python Implementation
- t1
- 715. Range Module
- Python Code
- attribute
- 30. Substring with Concatenation of All Words
- Python
- data science
- 315. Count of Smaller Numbers After Self
- Generator
- shiba
- 43. Multiply Strings
- DWG
- 109. Convert Sorted List to Binary Search Tree
- Decorator
- Convert Sorted List to Binary Search Tree
- kaggle
Archives
- Today
- Total
목록Find Peak Element (1)
Scribbling
LeetCode: 162. Find Peak Element
Binary Search class Solution: def findPeakElement(self, nums: List[int]) -> int: INT_MAX = int(1e12) nums = [-INT_MAX] + nums + [-INT_MAX] def isPeak(idx): if nums[idx] > nums[idx-1] and nums[idx] > nums[idx+1]: return True return False left, right = 1, len(nums) - 2 while left nums[mid]: right = mid - 1 else: left = mid + 1
Computer Science/Coding Test
2021. 12. 1. 22:23