Java 100% faster runtime
\npublic int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int count = 0;\n        int index = 0;\n        if (ruleKey.equ
```\npublic int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int count = 0;\n        int index = 0;\n        if (ruleKey.equals("color")) index = 1;\n        if (ruleKey.equals("name")) index = 2;\n        for (List<String> list : items) {\n            if (list.get(index).equals(ruleValue)) count++;\n        }\n        return count;\n    }\n```
['Java']