[Java] Find the Type Then Count
Here is my code, please let me know if you have any question.\n\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n    
Here is my code, please let me know if you have any question.\n```\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int type = 0;\n        if (ruleKey.equals("color")) type = 1;\n        else if (ruleKey.equals("name")) type = 2;\n        int res = 0;\n        for (List<String> i : items) {\n            if (i.get(type).equals(ruleValue)) res++; \n        }\n        return res;\n    }\n```
[]