1967. Number of Strings That Appear as Substrings in Word

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1967

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