Search
⌘K

Leetcode 1773. Count Items Matching a Rule

Given a list of items where each item is [type, color, name] and a ruleKey (type/color/name) plus ruleValue, return how many items have the corresponding field equal to ruleValue. This reduces to mapping ruleKey to a field index and performing a linear scan to count matches (O(n), n ≤ 10^4).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.