Java | O(n) | Easy solution ✅
\npublic int countGoodRectangles(int[][] rectangles) {\n\t\tint min, max = 0, previousMax=0, highesht = 0;\n\t\tfor (int j[] : rectangles) {\n\t\t\tmin = Math.m
```\npublic int countGoodRectangles(int[][] rectangles) {\n\t\tint min, max = 0, previousMax=0, highesht = 0;\n\t\tfor (int j[] : rectangles) {\n\t\t\tmin = Math.min(j[0], j[1]); \n\t\t\tpreviousMax = max;\n\t\t\tmax = Math.max(max, min);\n\t\t\thighesht = (max == min && previousMax == max) ? highesht + 1 : (previousMax <max) ? highesht = 1 : highesht;\n\t\t}\n\t\treturn highesht;\n    }\n```
['Java']