일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Class
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- 밴픽
- Substring with Concatenation of All Words
- attribute
- 운영체제
- Protocol
- Regular Expression
- Python Code
- Decorator
- Generator
- shiba
- 컴퓨터의 구조
- t1
- concurrency
- Python Implementation
- iterator
- 30. Substring with Concatenation of All Words
- kaggle
- Python
- 프로그래머스
- 315. Count of Smaller Numbers After Self
- 시바견
- data science
- 715. Range Module
- DWG
- 파이썬
- Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
Archives
- Today
- Total
목록2034. Stock Price Fluctuation (1)
Scribbling
LeetCode: 2034. Stock Price Fluctuation
1. Using heaps with lazy removal Below code uses 'MyHeap' data structure, a heap with lazy removal. Lazy removal here means, if we have to remove an element, we handle it by using another heap as a trash can. import heapq class MyHeap: def __init__(self, type='min'): self.heap = [] self.removals = [] self.sign = 1 if type == 'min' else -1 def insert(self, elem): heapq.heappush(self.heap, self.si..
Computer Science/Coding Test
2022. 3. 23. 10:59