Clean 7 lines C++ 6ms solution


  • 0
        int maxCount(int m, int n, vector<vector<int>>& ops) {
            int minRow=m;
            int minCol=n;
            for(int i=0;i<ops.size();i++){
                if(ops[i][0]<minRow) minRow=ops[i][0];
                if(ops[i][1]<minCol) minCol=ops[i][1];
            }
            return minRow*minCol;
        }
    

Log in to reply
 

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