The same solution I put took 24ms
but same other put took 12 ms
with no difference(sharply) how?
my solution ;-https://leetcode.com/submissions/detail/303715402/
author solution;-
'''
sample 12 ms submission
class Solution {
public:
int countNegatives(vector<vector>& grid) {
int n = grid.size();
int m = grid[0].size();
int res = 0;
for(int i = 0; i < n; i ++){
for(int j = 0; j < m; j ++){
if (grid[i][j] < 0){
res ++;
}
}
}
return res;
}
};
'''