C# simple solution using switch pattern
\npublic class Solution {\n    public int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n        \n        int res = 0;\n        
```\npublic class Solution {\n    public int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n        \n        int res = 0;\n        foreach(var item in items)\n        {\n            res += ruleKey switch {              \n                    "type" => item[0] == ruleValue ? 1 : 0,\n                    "color" => item[1] == ruleValue ? 1 : 0,\n                    "name" =>item[2] == ruleValue ? 1 : 0,\n                    _ => 0\n            };\n        }\n        \n        return res;\n    }\n}\n```
[]