#1773

Count Items Matching a Rule

newbie · 130 · lc easy +13 · verified · 85.3% accepted · 2,035 likes · top 96%

Description

You are given items[i] = [typei, colori, namei] and a rule (ruleKey, ruleValue). An item matches if its type, color, or name equals ruleValue (depending on ruleKey). Return the count of matching items.

Code

1
2
3