2255. Count Prefixes of a Given String

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 2255

class Solution:
    def countPrefixes(self, words: List[str], s: str) -> int:
        return sum(s.startswith(w) for w in words)