You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
note: the script for creating a new note for the daily problem seems to be stuck in the queue, so i've created this one manually. i'll delete the "jeremymanning.md" note if that action ever runs!
# [Problem 1380: Lucky Numbers in a Matrix](https://leetcode.com/problems/lucky-numbers-in-a-matrix/description/)
2
+
3
+
## Initial thoughts (stream-of-consciousness)
4
+
- Let's use set comprehensions to compute the minimum values in each row (`row_mins`) and the maximum values in each column (`column_maxes`)
5
+
- Then we can just return `list(row_mins.intersect(column_maxes))`
6
+
7
+
## Refining the problem, round 2 thoughts
8
+
- Since every element in the matrix is distinct (per the problem definition), we don't need to deal with the same value potentially appearing in different rows/columns (otherwise we'd also need to track the positions)
0 commit comments