Easy O(N) | Maintain a Set
We maintian a set called seen and add all the prefixes in the set and then simply check if the word in word list is present in the set or not\n\nLeave an upvote
We maintian a set called seen and add all the prefixes in the set and then simply check if the word in word list is present in the set or not\n\n***Leave an upvote if this helps!!!***\n```\nclass Solution:\n    def countPrefixes(self, words: List[str], s: str) -> int:\n        seen=set()\n        count=0\n        for i in range(1,len(s)+1):\n            seen.add(s[:i])\n        for i in words:\n            if i in seen:\n                count+=1\n        return count\n```
['Ordered Set', 'Python']