Java easy solution || faster than 98% || 6 lines of clean code || O(n)
\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        \n        int ans = 0;\n        int check
```\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        \n        int ans = 0;\n        int checkRuleNum = 0;\n        \n        if(ruleKey.equals("color")) checkRuleNum = 1; \n        else if(ruleKey.equals("name")) checkRuleNum = 2;\n        \n        for(int i  = 0 ; i< items.size() ; i++)\n            if((items.get(i).get(checkRuleNum)).equals(ruleValue) ) ans++;\n        return ans;\n    }\n}\n```
['Java']