Skip to content

Commit 9a2c355

Browse files
committed
Time: 1 ms (50.31%), Space: 42.8 MB (81.47%) - LeetHub
1 parent ea2968f commit 9a2c355

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Solution {
2+
public int countNegatives(int[][] grid) {
3+
int count = 0;
4+
// int max = grid[0][0];
5+
// int min = 0;
6+
7+
8+
// while(max > min){
9+
// int mid =
10+
// }
11+
for(int i = grid.length - 1; i >= 0; i--){
12+
for(int j = grid[i].length -1; j >= 0; j--){
13+
if(grid[i][j] < 0){
14+
count++;
15+
}
16+
}
17+
}
18+
19+
return count;
20+
}
21+
}

0 commit comments

Comments
 (0)