JAVA Simple Solution - 3ms beats 81.4%
\n\n# Code\n\nclass Solution {\n    public int countGoodRectangles(int[][] arr) {\n        int[] sq = new int[arr.length];\n        int m=arr.length;\n        i
\n\n# Code\n```\nclass Solution {\n    public int countGoodRectangles(int[][] arr) {\n        int[] sq = new int[arr.length];\n        int m=arr.length;\n        int n=arr[0].length;\n        for(int i=0;i<m;i++){\n            if(arr[i][0]<arr[i][1]){\n                sq[i]=arr[i][0];\n            }\n            else{\n                sq[i]=arr[i][1];\n            }\n            \n        }\n        int max = Largest(sq,m,0);\n        int count =0;\n        for(int i=0;i<m;i++){\n            if(max==sq[i]){\n                count+=1;\n            }\n        }\n        return count;\n    }\n    public static int Largest(int [] sq, int m, int i){\n        if(i==m-1){\n            return sq[i];\n        }\n        int large=Largest(sq,m,i+1);\n        return Math.max(large,sq[i]);\n    }\n}\n```
['Array', 'Java']