Skip to content

Commit fbe166e

Browse files
committed
Create README - LeetHub
1 parent ee529b2 commit fbe166e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<h2><a href="https://leetcode.com/problems/lucky-numbers-in-a-matrix/">1380. Lucky Numbers in a Matrix</a></h2><h3>Easy</h3><hr><div><p>Given an <code>m x n</code> matrix of <strong>distinct </strong>numbers, return <em>all <strong>lucky numbers</strong> in the matrix in <strong>any </strong>order</em>.</p>
2+
3+
<p>A <strong>lucky number</strong> is an element of the matrix such that it is the minimum element in its row and maximum in its column.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> matrix = [[3,7,8],[9,11,13],[15,16,17]]
9+
<strong>Output:</strong> [15]
10+
<strong>Explanation:</strong> 15 is the only lucky number since it is the minimum in its row and the maximum in its column.
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
15+
<pre><strong>Input:</strong> matrix = [[1,10,4,2],[9,3,8,7],[15,16,17,12]]
16+
<strong>Output:</strong> [12]
17+
<strong>Explanation:</strong> 12 is the only lucky number since it is the minimum in its row and the maximum in its column.
18+
</pre>
19+
20+
<p><strong class="example">Example 3:</strong></p>
21+
22+
<pre><strong>Input:</strong> matrix = [[7,8],[1,2]]
23+
<strong>Output:</strong> [7]
24+
<strong>Explanation:</strong> 7 is the only lucky number since it is the minimum in its row and the maximum in its column.
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li><code>m == mat.length</code></li>
32+
<li><code>n == mat[i].length</code></li>
33+
<li><code>1 &lt;= n, m &lt;= 50</code></li>
34+
<li><code>1 &lt;= matrix[i][j] &lt;= 10<sup>5</sup></code>.</li>
35+
<li>All elements in the matrix are distinct.</li>
36+
</ul>
37+
</div>

0 commit comments

Comments
 (0)