Java || with 98% efficiency
\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int ans =0;\n        int count =0;\n     
```\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int ans =0;\n        int count =0;\n        \n        // IMP note is that we can\'t use == method to check whether rule key and valuues are equal or not to our String bcz == method checks the address not the value for strings\n        if(ruleKey.equals("color"))\n            count=1;\n        else if(ruleKey.equals("name"))\n            count=2;\n        \n        for(int i =0;i<items.size();i++){\n            if(ruleValue.equals(items.get(i).get(count)))\n                ans++;\n        }\n        return ans;\n    }\n}\n```
['Java']