Very easy logic , for beginners !!
Intuition\nInitialize a variable count to store the count of prefixes found in the string s.\nIterate through each word in the words array.\nFor each word encou
# Intuition\nInitialize a variable count to store the count of prefixes found in the string s.\nIterate through each word in the words array.\nFor each word encountered, check if the string s starts with that word using the startsWith method.\nIf the word is found to be a prefix of s, increment the count.\nAfter iterating through all words in the words array, count holds the total number of prefixes found in the string s.\nReturn the count as the result.\n# Code\n```\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n        int count=0;\n        for(int i=0;i<words.length;i++){\n            if(s.startsWith(words[i])){\n                count++;\n            }\n        }return count;\n    }\n}\n```
['Java']