Python 2 lines clean solution
Python :\n\n\ndef countMatches(self, items: List[List[str]], ruleKey: str, ruleValue: str) -> int:\n\tkeys = {\'type\': 0, \'color\': 1, \'name\': 2}\n\treturn 
**Python :**\n\n```\ndef countMatches(self, items: List[List[str]], ruleKey: str, ruleValue: str) -> int:\n\tkeys = {\'type\': 0, \'color\': 1, \'name\': 2}\n\treturn sum(1 for item in items if item[keys[ruleKey]] == ruleValue)\n```\n\n**Like it ? please upvote !**
['Python', 'Python3']