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