Easiest solution
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {\n        int i;\n        if(ruleKey.equals("type"))i=0;\n        else if(ruleKey.equals("color"))i=1;\n        else i=2;\n        int count=0;\n        for(List<String> list :items){\n           if(ruleValue.equals(list.get(i))){\n            count=count+1;\n           }\n        }\n        return count;\n    }\n}\n```
['String', 'Java']