Kotlin 1 line
\nfun countMatches(l: List<List<String>>, k: String, v: String) = l.count { it[when(k){"type"->0 "color"->1 else->2}] == v }\n\n\nOr:\n\nfun countMatches(l: Lis
```\nfun countMatches(l: List<List<String>>, k: String, v: String) = l.count { it[when(k){"type"->0 "color"->1 else->2}] == v }\n```\n\n***Or:***\n```\nfun countMatches(l: List<List<String>>, r: String, v: String) = arrayOf("type", "color", "name").run {\n    l.count { it[indexOf(r)] == v }\n}\n```
['Kotlin']