easy to understand || 0ms || accepted solution
Intuition\nwe need to first find minima of each sub-array and then find maxima of all the minimas and then check how many times that maxima is occuring in  the 
# Intuition\nwe need to first find minima of each sub-array and then find maxima of all the minimas and then check how many times that maxima is occuring in  the array of minimas.\n# Approach\nwe first iterate through the array rectangles and find minima of each sub-array and store them in a new array mins. then find the maxima of mins and initate a variable count with 0. now iterate through the array mins and check how many of its elements are equal to max and increment count each time the element is equal to max and return count. \n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(n)$$ \n\n# Code\n```\nclass Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n        int n = rectangles.length;\n        int min = 0;\n        int[] mins = new int[n];\n        for(int i = 0; i<n; i++){\n            min = rectangles[i][0];\n            if(min > rectangles[i][1]){\n                min = rectangles[i][1];\n            }\n            mins[i] = min;\n        }\n        int max = mins[0];\n        for(int j = 0; j<n; j++){\n            max = Math.max(max, mins[j]);\n        }\n        int count = 0;\n        for(int k = 0; k<n; k++){\n            if(mins[k]==max){\n                count++;\n            }\n        }\n\n        return count;\n    }\n}\n```
['Array', 'Java']