C++ easy solution for beginner
\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        vector<int> vec;\n        int mini=INT_MAX;\n        int co
```\nclass Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        vector<int> vec;\n        int mini=INT_MAX;\n        int count=1;\n        for(int i=0;i<rectangles.size();i++){\n              mini=min(rectangles[i][0],rectangles[i][1]);\n               vec.push_back(mini);\n           } \n        sort(vec.begin(),vec.end(), greater<int>());\n        int first=vec[0];\n        for(int i=1;i<vec.size();i++){\n            if(first==vec[i]){\n                count++;\n            }\n        }\n       return count; \n    }\n};\n\n/* steps: 1- find the min value for every row\n          2- sort it int descendin order\n          3- increase the pointer if the value is similar to \n          the value at first index and increase the counter. */\n\t\t  \n\t\t  // ****** second solution- optimized: ***************\n\t\t  class Solution {\npublic:\n    int countGoodRectangles(vector<vector<int>>& rectangles) {\n        int mini=INT_MAX;\n        int maxi=INT_MIN;\n        int count=1;\n        for(int i=0;i<rectangles.size();i++){\n              mini=min(rectangles[i][0],rectangles[i][1]);\n            if(mini>maxi){\n                maxi=mini;\n                count=1;\n            }\n            else if(mini==maxi){\n                count++;\n            }\n           } \n        return count; \n    }\n};\n```
['C', 'C++']