일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 프로그래머스
- 파이썬
- Convert Sorted List to Binary Search Tree
- 30. Substring with Concatenation of All Words
- Decorator
- DWG
- LeetCode
- 43. Multiply Strings
- data science
- kaggle
- 밴픽
- Python Code
- Python
- Generator
- shiba
- 운영체제
- 컴퓨터의 구조
- Regular Expression
- 715. Range Module
- attribute
- concurrency
- Class
- iterator
- 시바견
- Substring with Concatenation of All Words
- 109. Convert Sorted List to Binary Search Tree
- Python Implementation
- 315. Count of Smaller Numbers After Self
- t1
- Protocol
Archives
- Today
- Total
목록Search a 2D Matrix II (1)
Scribbling
LeetCode: 240. Search a 2D Matrix II
Several different solutions class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: j = bisect_right(matrix[0], target) - 1 i = bisect_right([mat[0] for mat in matrix], target) - 1 while i >= 0 and j >= 0: if matrix[i][j] < target: return False for k in range(0, i+1): if matrix[k][j] == target: return True for k in range(0, j+1): if matrix[i][k] == target: return Tr..
Computer Science/Coding Test
2021. 12. 27. 14:41