JAVA solution | startsWith() or indexOf() ✅
Please Upvote :D\n\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n        int count = 0;\n        \n        for (String str : word
### Please Upvote :D\n```\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n        int count = 0;\n        \n        for (String str : words) {\n            // if (s.indexOf(str) == 0) count++;\n            if (s.startsWith(str)) count++;\n        }\n        \n        return count;\n    }\n}\n\n// TC: O(n)\n```
['Java']