1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
class Solution:
def luckyNumbers (self, matrix: List[List[int]]) -> List[int]:
rowMin = []
colMax=[]
ans=[]
for i in matrix:
rowMin.append(min(i))
for j in range(len(matrix[0])):
tmpCol=[]
for i in range(len(matrix)):
tmpCol.append(matrix[i][j])
colMax.append(max(tmpCol))
for i in rowMin:
if i in colMax: ans.append(i)
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2085. Count Common Words With One Occurrence (0) | 2022.03.22 |
---|---|
leetcode 852. Peak Index in a Mountain Array (0) | 2022.03.22 |
leetcode 1356. Sort Integers by The Number of 1 Bits (0) | 2022.03.22 |
leetcode 977. Squares of a Sorted Array (0) | 2022.03.22 |
leetcode 1207. Unique Number of Occurrences (0) | 2022.03.22 |
댓글