Simple and fast  C++ O(n) solution.
\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue)\n    {\n        int count = 0;\n        for(i
```\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue)\n    {\n        int count = 0;\n        for(int i=0;i<items.size();i++)\n        {\n            if(ruleKey == "type" && items[i][0] == ruleValue)\n            {\n                count++;\n            }\n            else if(ruleKey == "color" && items[i][1] == ruleValue)\n            {\n                count++;\n            }\n            else if(ruleKey == "name" && items[i][2] == ruleValue)\n            {\n                count++;\n            }\n        }\n        return count;\n    }\n};\n```
['C', 'C++']