1 line of code🔥100% faster code 🔥Beginner friendly🔥
Please UPVOTE if helps.\n# Complexity\n- Time complexity: O(n^2)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space comple
# Please UPVOTE if helps.\n# Complexity\n- Time complexity: $$O(n^2)$$\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 countPrefixes(String[] words, String s) {;\n        int count = 0; for (String w: words) if (s.startsWith(w)) count++;\n        return count;        \n    }\n}\n```
['Java']