/**
* @param {string[][]} items
* @param {string} ruleKey
* @param {string} ruleValue
* @return {number}
*/
var countMatches = function (items, ruleKey, ruleValue) {
if (items.length < 1 || items.length > Math.pow(10, 4)) {
return;
}
const key = ruleKey === 'type' ? 0 : ruleKey === 'color' ? 1 : 2;
return items.filter(s => s[key] === ruleValue).length;
};