Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite5f2a69

Browse files
refactor 1351
1 parentf4ce5b3 commite5f2a69

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

‎src/main/java/com/fishercoder/solutions/_1351.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
packagecom.fishercoder.solutions;
22

3-
/**
4-
* 1351. Count Negative Numbers in a Sorted Matrix
5-
*
6-
* Given a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise.
7-
* Return the number of negative numbers in grid.
8-
*
9-
* Example 1:
10-
* Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
11-
* Output: 8
12-
* Explanation: There are 8 negatives number in the matrix.
13-
*
14-
* Example 2:
15-
* Input: grid = [[3,2],[1,0]]
16-
* Output: 0
17-
*
18-
* Example 3:
19-
* Input: grid = [[1,-1],[-1,-1]]
20-
* Output: 3
21-
*
22-
* Example 4:
23-
* Input: grid = [[-1]]
24-
* Output: 1
25-
*
26-
* Constraints:
27-
* m == grid.length
28-
* n == grid[i].length
29-
* 1 <= m, n <= 100
30-
* -100 <= grid[i][j] <= 100
31-
* */
323
publicclass_1351 {
334
publicstaticclassSolution1 {
345
publicintcountNegatives(int[][]grid) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp