[JAVA] min i and j / T : O(N), S : O(1)


  • 0
    J
    class Solution {
        public int maxCount(int m, int n, int[][] ops) {
            int min_i = m;
            int min_j = n;
            for(int[] op : ops){
                if(op[0] < min_i)
                    min_i = op[0];
                
                if(op[1] < min_j)
                    min_j = op[1];
            }
            
            return min_i * min_j;
        }
    }
    

Log in to reply
 

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