Simple C++ Solution TC: O(N) SC: O(1)
\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        \n        int max = 0, count = 0;\n        \n        //Loop
```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        \n        int max = 0, count = 0;\n        \n        //Loop through each of the rectangles\n        for(vector side: rectangles) {\n            //find the minimum size of rectangle\n            int s = side[0] < side[1] ? side[0] : side[1];\n            \n            // if the current size is greater than the other sizes set the current size as max and \n            // initialize the count to 0            \n            if(s > max) {\n                max = s;\n                count = 1;\n            } \n            //if current size is equal to the max size increment the counter\n            else if (s == max) {\n                count++;\n            }\n            //ignore if the current size is lesser than the max size\n        }\n        return count;\n    }\n};\n```
[]