java
\n    public static int countGoodRectangles(int[][] rectangles) {\n        int count = 0, max = 0;\n\n        for (int i = 0; i < rectangles.length; i++) {\n   
```\n    public static int countGoodRectangles(int[][] rectangles) {\n        int count = 0, max = 0;\n\n        for (int i = 0; i < rectangles.length; i++) {\n            int min = Math.min(rectangles[i][0], rectangles[i][1]);\n\n            if (min > max) {\n                max = min;\n                count = 1;\n            } else if (min == max) {\n               count++;\n            }\n\n        }\n\n        return count;\n    }\n```
['Java']