Advertisement
sajid161

16:5

Apr 17th, 2021
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. class Solution {
  2. public:
  3.     int countNegatives(vector<vector<int>>& grid) {
  4.         int coun=0;
  5.         for(auto u:grid)
  6.         {
  7.             reverse(u.begin(),u.end());
  8.           int lo=lower_bound(u.begin(),u.end(),0)-u.begin();
  9.             coun+=lo;
  10.         }
  11.         return coun;
  12.        
  13.     }
  14. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement