2255. Count Prefixes of a Given String Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 2255class Solution: def countPrefixes(self, words: List[str], s: str) -> int: return sum(s.startswith(w) for w in words)