Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- int countNegatives(vector<vector<int>>& grid) {
- int ans = 0;
- for (auto u : grid) {
- reverse(u.begin(), u.end());
- ans += lower_bound(u.begin(), u.end(), 0) - u.begin();
- }
- return ans;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement