Java Solution Without map O(1) space linear time
class Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n      int countRec=0;\n        int maxLen=0;\n        for(int i[]:rectangles){\n    
class Solution {\n    public int countGoodRectangles(int[][] rectangles) {\n      int countRec=0;\n        int maxLen=0;\n        for(int i[]:rectangles){\n            int length=i[0];\n            int width=i[1];\n            int currMaxLen=Math.min(length,width);\n            if(currMaxLen>maxLen){\n                maxLen=currMaxLen;\n                countRec=1;\n            }\n            else if(currMaxLen==maxLen){++countRec;}\n        }\n        return countRec;\n    }\n}
[]