C++ 3 lines concise solution


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

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.