일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 315. Count of Smaller Numbers After Self
- 30. Substring with Concatenation of All Words
- Substring with Concatenation of All Words
- data science
- 43. Multiply Strings
- Python Implementation
- 밴픽
- iterator
- DWG
- kaggle
- 컴퓨터의 구조
- Convert Sorted List to Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree
- Regular Expression
- Class
- 파이썬
- 운영체제
- Decorator
- Python Code
- shiba
- 715. Range Module
- Generator
- 프로그래머스
- attribute
- Protocol
- 시바견
- t1
- LeetCode
- concurrency
Archives
- Today
- Total
목록407. Trapping Rain Water II (1)
Scribbling
LeetCode: 407. Trapping Rain Water II
class Solution: def trapRainWater(self, heightMap: List[List[int]]) -> int: import heapq boundaries = [] m, n = len(heightMap), len(heightMap[0]) visited = [[False] * n for _ in range(m)] for y in range(m): for x in range(n): if y == 0 or y == m - 1 or x == 0 or x == n - 1: heapq.heappush(boundaries, (heightMap[y][x], y, x)) visited[y][x] = True ret = 0 dy, dx = [0, 1, 0, -1], [1, 0, -1, 0] whil..
Computer Science/Coding Test
2022. 3. 8. 11:00