C++ SOLUTION USING MAP
\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue) {\n        unordered_map<string,vector<string
```\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue) {\n        unordered_map<string,vector<string>> mp;\n        for(int i=0;i<items.size();++i){\n           mp["type"].push_back(items[i][0]);\n           mp["color"].push_back(items[i][1]);\n           mp["name"].push_back(items[i][2]); \n        }\n        int count=0;\n        for(const auto &i:mp[ruleKey]){\n            if(i==ruleValue) ++count;\n        }\n        return count;\n    }\n};\n```
['C', 'C++']