Practice Number of Strings That Appear as Substrings in Word
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word. A substring is a contiguous sequence of characters within a string.
Source: Number of Strings That Appear as Substrings in Word on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
patterns = ["a","abc","bc","d"], word = "abc"
Output
3
# Example 2
Input
patterns = ["a","b","c"], word = "aaaaabbbbb"
Output
2
# Example 3
Input
patterns = ["a","a","a"], word = "ab"
Output
3
Constraints
1 <= patterns.length <= 100
1 <= patterns[i].length <= 100
1 <= word.length <= 100
patterns[i] and word consist of lowercase English letters.
Related LeetCode Problems
Practice more problems similar to Number of Strings That Appear as Substrings in Word.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.