Beats 95.76% || Count items matching a rule
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countMatches(self, items: List[List[str]], ruleKey: str, ruleValue: str) -> int:\n        count=0\n        if ruleKey=="type":\n            for i in range(len(items)):\n                if ruleValue==items[i][0]:\n                    count+=1\n        if ruleKey=="color":\n            for i in range(len(items)):\n                if ruleValue==items[i][1]:\n                    count+=1\n        if ruleKey=="name":\n            for i in range(len(items)):\n                if ruleValue==items[i][2]:\n                    count+=1\n        return count\n        \n```
['Python3']