[C++] O(N) Time O(1) Space Solution
Idea:\nWe traverse the whole vector. For each rectangle\'s maxLen curLen, we compare it with the global maxLen maxLen. If\n curLen > maxLen, we know the maxLen 
Idea:\nWe traverse the whole vector. For each rectangle\'s maxLen `curLen`, we compare it with the global maxLen `maxLen`. If\n* `curLen > maxLen`, we know the `maxLen` should be updated.\n* `curLen == maxLen`, we know we should `++res`.\n* Otherwise, we just ignore.\n\n```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        int maxLen = 0;\n        int res = 0;\n        for (vector<int>& r : rectangles) {\n            int curLen = min(r[0], r[1]);\n            if (maxLen < curLen) {\n                res = 1;\n                maxLen = curLen;\n            } else if (maxLen == curLen) ++res;\n        }\n        return res;\n    }\n};\n```
['C']