SOUTION - n(0) Time Complexity✅ 100% Beats✅
Intuition\nEASY to Solve && Beginner friendly\n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time complexity:\n Add your tim
# Intuition\nEASY to Solve && Beginner friendly\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\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 res = 0;\n        for(int i=0; i<items.size(); i++){\n            if(ruleKey.equals("type")){\n                if(items.get(i).get(0).equals(ruleValue)){\n                    res++;\n                }\n            }else if(ruleKey.equals("color")){\n                if(items.get(i).get(1).equals(ruleValue)){\n                    res++;\n                }\n            }else{\n                if(items.get(i).get(2).equals(ruleValue)){\n                    res++;\n                }\n            }\n        }\n        return res;\n    }\n}\n```
['Java']