C# Solution
\npublic int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n\treturn items.Count(item => item[ruleKey == "type" ? 0 : ruleKey == 
```\npublic int CountMatches(IList<IList<string>> items, string ruleKey, string ruleValue) {\n\treturn items.Count(item => item[ruleKey == "type" ? 0 : ruleKey == "color" ? 1 : 2] == ruleValue);\n}\n```
[]