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