【leetcode_easy】598. Range Addition II

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;

 

posted on 2019-06-20 16:24  鹅要长大  阅读(131)  评论(0编辑  收藏  举报

导航