Simple Java Solution, 10 lines


  • 0
    A
    public class Solution {
        public int maxCount(int m, int n, int[][] ops) {
            int[] result = new int[]{m, n};
            for (int i = 0; i < ops.length; i++) {
                result[0] = Math.min(result[0], ops[i][0]);
                result[1] = Math.min(result[1], ops[i][1]);
            }
            return result[0] * result[1];
        }
    }
    

Log in to reply
 

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