일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- kaggle
- concurrency
- attribute
- Protocol
- 컴퓨터의 구조
- 30. Substring with Concatenation of All Words
- 운영체제
- Python Code
- 715. Range Module
- Python
- shiba
- Regular Expression
- DWG
- 파이썬
- 109. Convert Sorted List to Binary Search Tree
- 프로그래머스
- Generator
- Convert Sorted List to Binary Search Tree
- 315. Count of Smaller Numbers After Self
- 밴픽
- LeetCode
- iterator
- data science
- Class
- 43. Multiply Strings
- 시바견
- Decorator
- t1
- Substring with Concatenation of All Words
- Python Implementation
Archives
- Today
- Total
목록162. 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