일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 운영체제
- LeetCode
- shiba
- concurrency
- Convert Sorted List to Binary Search Tree
- attribute
- Regular Expression
- Python Implementation
- 30. Substring with Concatenation of All Words
- Protocol
- kaggle
- 43. Multiply Strings
- t1
- Class
- iterator
- Decorator
- 715. Range Module
- data science
- 315. Count of Smaller Numbers After Self
- 밴픽
- 109. Convert Sorted List to Binary Search Tree
- Python Code
- DWG
- 프로그래머스
- 시바견
- Generator
- 파이썬
- 컴퓨터의 구조
- Substring with Concatenation of All Words
Archives
- Today
- Total
목록Smallest Rectangle Enclosing Black Pixels (1)
Scribbling
LeetCode: 302. Smallest Rectangle Enclosing Black Pixels
Perhaps, the most thinkable solution would be DFS or BFS. Traverse all the '1' points and update mins and maxs. Time complexity would be O(M*N) in this case. class Solution: def minArea(self, image: List[List[str]], x: int, y: int) -> int: m, n = len(image), len(image[0]) ymin, ymax, xmin, xmax = m, -1, n, -1 dy, dx = [0, 1, 0, -1], [1, 0, -1, 0] stack, visited = [(x, y)], set() while stack: i, ..
Computer Science/Coding Test
2022. 1. 25. 13:47