You are given an array items where each items[i] = [type_i, color_i, name_i]. You are also given a rule represented by two strings ruleKey and ruleValue. Return the number of items that match the given rule.
- ruleKey = "type" matches items[i][0]
- ruleKey = "color" matches items[i][1]
- ruleKey = "name" matches items[i][2]
Input: A 2D string array items, a string ruleKey, and a string ruleValue.
Output: Integer — count of items matching the rule.
Input: [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]],"color","silver"
Output: 1
Explanation: Only item 1 has color='silver'. Return 1.Input: [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]],"type","phone"
Output: 2
Explanation: Items 0 and 2 have type='phone'. Return 2.Input: [["phone","blue","pixel"],["computer","silver","phone"],["phone","gold","iphone"]],"name","pixel"
Output: 1
Explanation: Only item 0 has name='pixel'. Return 1.1 <= items.length <= 10^41 <= type_i, color_i, name_i, ruleValue.length <= 10ruleKey is 'type', 'color', or 'name'