Skip to content

Commit 55d5d82

Browse files
committed
Create README - LeetHub
1 parent 6d403ab commit 55d5d82

File tree

1 file changed

+30
-0
lines changed
  • 1476-count-negative-numbers-in-a-sorted-matrix

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2><a href="https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix">1476. Count Negative Numbers in a Sorted Matrix</a></h2><h3>Easy</h3><hr><p>Given a <code>m x n</code> matrix <code>grid</code> which is sorted in non-increasing order both row-wise and column-wise, return <em>the number of <strong>negative</strong> numbers in</em> <code>grid</code>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong class="example">Example 1:</strong></p>
5+
6+
<pre>
7+
<strong>Input:</strong> grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
8+
<strong>Output:</strong> 8
9+
<strong>Explanation:</strong> There are 8 negatives number in the matrix.
10+
</pre>
11+
12+
<p><strong class="example">Example 2:</strong></p>
13+
14+
<pre>
15+
<strong>Input:</strong> grid = [[3,2],[1,0]]
16+
<strong>Output:</strong> 0
17+
</pre>
18+
19+
<p>&nbsp;</p>
20+
<p><strong>Constraints:</strong></p>
21+
22+
<ul>
23+
<li><code>m == grid.length</code></li>
24+
<li><code>n == grid[i].length</code></li>
25+
<li><code>1 &lt;= m, n &lt;= 100</code></li>
26+
<li><code>-100 &lt;= grid[i][j] &lt;= 100</code></li>
27+
</ul>
28+
29+
<p>&nbsp;</p>
30+
<strong>Follow up:</strong> Could you find an <code>O(n + m)</code> solution?

0 commit comments

Comments
 (0)