Java solution
\n\nclass Solution {\n   public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int count = 0;\n        final String rul
\n```\nclass Solution {\n   public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int count = 0;\n        final String ruleKey1 = "type",\n                ruleKey2 = "color",\n                ruleKey3 = "name";\n\n        switch (ruleKey) {\n            case ruleKey1:\n                for (List<String> item : items) {\n                    if (ruleValue.equals(item.get(0))) {\n                        count++;\n                    }\n                }\n                break;\n\n            case ruleKey2:\n                for (List<String> item : items) {\n                    if (ruleValue.equals(item.get(1))) {\n                        count++;\n                    }\n                }\n                break;\n\n            case ruleKey3:\n                for (List<String> item : items) {\n                    if (ruleValue.equals(item.get(2))) {\n                        count++;\n                    }\n                }\n                break;\n        }\n\n        return count;\n    }\n}\n```
['Java']