Java Accepted Runtime:O(n) and Space:O(n)
\nclass Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n        \n        int[] sq=new int[rectangles.length];\n        int max=Integer.MI
```\nclass Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n        \n        int[] sq=new int[rectangles.length];\n        int max=Integer.MIN_VALUE; //will stores maxLen\n        for(int i=0;i<rectangles.length;i++)\n        {\n            sq[i]=Math.min(rectangles[i][0],rectangles[i][1]);\n            if(max<sq[i])\n            {\n                max=sq[i];\n            }\n        }\n        int count=0;\n\t\t//checking how many squares will have sides equal to maxLen\n        for(int i=0;i<sq.length;i++)\n        {\n            if(max==sq[i])\n            {\n                count++;\n            }\n        }\n        return count;\n        \n    }\n}\n```
['Java']