Java simple solution


  • 4
    U
    public class Solution {
        public int maxCount(int m, int n, int[][] ops) {
            int rowMin = m;
            int colMin = n;
            for (int[] pair : ops) {
                rowMin = Math.min(rowMin, pair[0]);
                colMin = Math.min(colMin, pair[1]);
            }
            return rowMin * colMin;
        }
    }
    

Log in to reply
 

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