c++ | easy | step by step
\n# Code\n\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        unordered_map<int,int> map;\n        for(vector<i
\n# Code\n```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        unordered_map<int,int> map;\n        for(vector<int> rectangle: rectangles){\n            map[min(rectangle[0],rectangle[1])]++;\n        }\n        int cnt=INT_MIN,maxlen=INT_MIN;\n        for(auto m: map){\n            if(m.first>maxlen) cnt=m.second,maxlen=m.first; \n        }\n        return cnt;\n    }\n};\n```
['C++']