统计匹配检索规则的物品数量
class Solution:
def countMatches(self, items: List[List[str]], ruleKey: str, ruleValue: str) -> int:
if ruleKey == "type":
col = 0
elif ruleKey == "color":
col = 1
else:
col = 2
count = 0
for row in range(len(items)):
if items[row][col] == ruleValue:
count += 1
return count