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