Simple Java Solution


  • 0
    V
    public class Solution {
        public int maxCount(int m, int n, int[][] ops) {
            int x = m;
            int y = n;
            for (int i = 0; i < ops.length; i++) {
                int[] op = ops[i];
                if (op[0] <= x) {
                    x = op[0];
                }
                if (op[1] <= y) {
                    y = op[1];
                }
            }
            return x * y;
        }
    }
    

Log in to reply
 

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