Easy Java Solution 100% faster ! Optimized Code!!
Easy Solution!!\n\n\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) \n    {\n        int j=0;\n      
**Easy Solution!!**\n\n```\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) \n    {\n        int j=0;\n        int count=0;\n        switch(ruleKey)\n        {\n                case "type" -> j=0;\n                case "color" -> j=1;\n                default -> j=2;\n        }\n        for(int i=0;i<items.size();i++)\n        {\n            if(items.get(i).get(j).equals(ruleValue))\n                count++;\n        }\n        return count;\n    }\n}\n```\n\n**Comment if You have better Approach & found it helpful !!!**
['Java']