C# Simple solution using dictionary
\npublic class Solution {\n    public int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n        var dict = new Dictionary<string
```\npublic class Solution {\n    public int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n        var dict = new Dictionary<string, int> {{"type", 0}, {"color", 1}, {"name", 2}};\n        int count = 0;\n\t\t\n        foreach (var item in items) {\n            if (item[dict[ruleKey]] == ruleValue)\n                count++;\n        }\n\n        return count;\n    }\n}\n```\n\nSame solution with LINQ\n```\npublic class Solution {\n    public int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n        var dict = new Dictionary<string, int> {{"type", 0}, {"color", 1}, {"name", 2}};\n\t\t\n        return items.Count(item => item[dict[ruleKey]] == ruleValue);\n    }\n}\n```
[]