2099. Number of Strings That Appear as Substrings in Word
My accepted Python solution to LeetCode problem 2099, Number of Strings That Appear as Substrings in Word, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.5MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.5MB, accepted 2025-12-31.
class Solution:
def numOfStrings(self, patterns: List[str], word: str) -> int:
return sum(1 for p in patterns if p in word)