【leetcode_easy_array】1380. Lucky Numbers in a Matrix

problem

1380. Lucky Numbers in a Matrix

在矩阵中,如果一个数既是它所在行的最小值,又是它所在列的最大值,则称这个数为幸运数。找到矩阵中所有的幸运数。

Constraints

All elements in the matrix are distinct.

solution1:

每次先找到一行的最小值,再判断它是不是所在列的最大值。

code

 

注意

1. 如何在计算得到行最小值的同时判断是否是所在列的最大值;

参考

1. leetcode_1380. Lucky Numbers in a Matrix;

posted on 2020-07-15 22:09  鹅要长大  阅读(116)  评论(0编辑  收藏  举报

导航