grid whose numbers are all distinct. Find every number that is both the smallest in its row and the largest in its column.
Return them in any order; if there are none, return an empty list.grid=[[4, 9, 6], [12, 10, 15], [2, 8, 1]] → [10]
10 is the smallest in its row [12, 10, 15] and the largest in its column [9, 10, 8].
grid=[[3, 1], [2, 4]] → []
The row minimums are 1 and 2, but 1 is not the top of its column [1, 4], and 2 is not the top of [3, 2]. The answer is empty.
grid=[[5, 7, 3]] → [3]
grid=[[4, 9, 6], [12, 10, 15], [2, 8, 1]]
[10]
Run checks the first 3 tests in your browser. Submit checks all 63 tests on the server, hidden ones included.