Skip to content

Commit f38c7e1

Browse files
committed
Time: 15 ms (31.11%), Space: 10.9 MB (9.85%) - LeetHub
1 parent d340a1f commit f38c7e1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

1476-count-negative-numbers-in-a-sorted-matrix/1476-count-negative-numbers-in-a-sorted-matrix.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ class Solution {
22
public:
33
int countNegatives(vector<vector<int>>& x) {
44
int neg = 0;
5-
for (int i = 0; i < (int)x.size(); i++)
6-
{
5+
for (int i = 0; i < (int)x.size(); i++){
76
neg += upper_bound(x[i].rbegin(), x[i].rend(), -1) - x[i].rbegin();
8-
97
}
108
return neg;
119
}

0 commit comments

Comments
 (0)