1380. Lucky Numbers in a Matrix

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1380

class Solution:
    def luckyNumbers(self, matrix: List[List[int]]) -> List[int]:
        rows = {min(row) for row in matrix}
        cols = {max(col) for col in zip(*matrix)}
        return list(rows & cols)