Easy Method || c++ |
```\nclass Solution {\npublic:\n    int countMatches(vector>& items, string r1, string r2) {\n        int k;\n        int count =0;\n        if(r1 == "type")\n 
```\nclass Solution {\npublic:\n    int countMatches(vector<vector<string>>& items, string r1, string r2) {\n        int k;\n        int count =0;\n        if(r1 == "type")\n            k=0;\n        else if(r1 == "color")\n            k=1;\n        else \n            k=2;\n        \n        \n        \n        cout<<k;\n        for(int i=0;i<items.size();i++){\n                if(items[i][k]==r2)\n                    count++;\n            }\n        \n        return count;\n    }\n};
['C', 'C++']