Java easy solution


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

Log in to reply
 

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