problem

​598. Range Addition II​

题意:

第一感觉就是最小的行和列的乘积即是最后结果。

class Solution {
public:
int maxCount(int m, int n, vector<vector<int>>& ops) {
for(auto op : ops)
{
m = min(m, op[0]);
n = min(n, op[1]);
}
return m*n;
}
};

 

参考

1. ​​Leetcode_easy_598. Range Addition II​​;

2. ​​Grandyang​​;