Java simple O(n) solution > 100%
\n\nclass Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n        int largestSide = Integer.MIN_VALUE;\n        int countLargest = 0;\n   
```\n\nclass Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n        int largestSide = Integer.MIN_VALUE;\n        int countLargest = 0;\n        \n        for(int[] rect: rectangles) {\n            int localMinSide = Math.min(rect[0], rect[1]); //Find the largest square that can be created from this rect\n            \n            if(localMinSide > largestSide) {\n                countLargest = 1; //Reset to 1 for the new largest side\n                largestSide = localMinSide;\n            } else if(localMinSide == largestSide) {\n                countLargest++;   //Or else keep incrementing\n            }\n        }\n        \n        return countLargest;\n    }\n}\n\n```\n\n```TC: O(n) SC: O(1)```
[]