Java Solution beats 100% | T.C-O(n) S.C-O(1)
\n    public int countGoodRectangles(int[][] rectangles) {\n        \n\t\tint ans = -1;\n\t\tint count = 0;\n\n\t\tfor (int[] rectangle : rectangles) {\n\n\t\t\
\n    public int countGoodRectangles(int[][] rectangles) {\n        \n\t\tint ans = -1;\n\t\tint count = 0;\n\n\t\tfor (int[] rectangle : rectangles) {\n\n\t\t\tint min = Math.min(rectangle[0], rectangle[1]);\n\t\t\tif (min > ans) {\n\t\t\t\tans = min;\n\t\t\t\tcount = 1;\n\t\t\t} else if (min == ans)\n\t\t\t\tcount++;\n\t\t}\n\n\t\treturn count;\n    }\n
[]