Skip to content

Commit d340a1f

Browse files
committed
Time: 16 ms (19.63%), Space: 10.7 MB (58.97%) - LeetHub
1 parent 55d5d82 commit d340a1f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
public:
3+
int countNegatives(vector<vector<int>>& x) {
4+
int neg = 0;
5+
for (int i = 0; i < (int)x.size(); i++)
6+
{
7+
neg += upper_bound(x[i].rbegin(), x[i].rend(), -1) - x[i].rbegin();
8+
9+
}
10+
return neg;
11+
}
12+
};

0 commit comments

Comments
 (0)