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