1967. Number of Strings That Appear as Substrings in Word

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

Содержание

LeetCode problem 1967

class Solution:
    def numOfStrings(self, patterns: List[str], word: str) -> int:
        return sum(p in word for p in patterns)