Java O(n) Solution
\nhttps://achievementguru.com/leetcode-1725-number-of-rectangles-that-can-form-the-largest-square-java-solution/\n\nclass Solution {\n    public int countGoodRe
\nhttps://achievementguru.com/leetcode-1725-number-of-rectangles-that-can-form-the-largest-square-java-solution/\n```\nclass Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n        int [] sq =  new int[rectangles.length];\n        \n        for(int i=0;i<rectangles.length;i++)\n            sq[i]=Math.min(rectangles[i][0],rectangles[i][1]);\n        \n        \n        int count = 0;\n        int max =sq[0];\n        for(int i=0;i<sq.length;i++)\n            if(sq[i]>max)\n                max=sq[i];\n        \n        for(int i=0;i<sq.length;i++){\n            if(sq[i]==max)\n                count++;\n        \n        }\n        \n        return count;\n        \n    }\n}\n```
['Java']