Faster than 100% of C++ submissions
\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue) {\n        int count = 0, pos = 0;\n        i
```\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string ruleKey, string ruleValue) {\n        int count = 0, pos = 0;\n        if(ruleKey[0] == \'t\') pos = 0;\n        else if(ruleKey[0] == \'c\') pos = 1;\n        else pos = 2;\n        for(auto& i : items) {\n            if(i[pos] == ruleValue) count++;\n        }\n        return count;\n    }\n};\n```
['C', 'C++']