Hashmap C++
\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& r) {\n        unordered_map<int,int>mp;\n        for(int i=0;i<r.size();i++){\n   
```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& r) {\n        unordered_map<int,int>mp;\n        for(int i=0;i<r.size();i++){\n            if(r[i][0]<r[i][1]){\n                mp[r[i][0]]++;\n            }else{\n                mp[r[i][1]]++;\n            }\n        }\n        int m=INT_MIN,c=0;\n        for(auto i:mp){\n            if(i.first>m){\n                m=i.first;\n                c=i.second;\n            }\n        }\n        return c;\n    }\n};\n```
[]