LeetCode --- 1380. Lucky Numbers in a Matrix 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1380. Lucky Numbers in a Matrix 解题报告相关的知识,希望对你有一定的参考价值。

Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.

lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column.

Example 1:

Input: matrix = [[3,7,8],[9,11,13],[15,16,17]]
Output: [15]
Explanation: 15 is the only lucky number since it is the minimum in its row and the maximum in its column.

Example 2:

Input: matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]
Output: [12]
Explanation: 12 is the only lucky number since it is the minimum in its row and the maximum in its column.

Example 3:

Input: matrix = [[7,8],[1,2]]
Output: [7]

以上是关于LeetCode --- 1380. Lucky Numbers in a Matrix 解题报告的主要内容,如果未能解决你的问题,请参考以下文章

1380. Lucky Numbers in a Matrix

九度oj 题目1380:lucky number

leetcode1380

LeetCode 1380 矩阵中的幸运数[数组] HERODING的LeetCode之路

leetcode1394. Find Lucky Integer in an Array

LeetCode --- 1394. Find Lucky Integer in an Array 解题报告