Number of Strings That Appear as Substrings in Word LeetCode solution in Java

1
class Solution {
2
public int numOfStrings(String[] patterns, String word) {
3
int count = 0;
4
for (int i = 0; i < patterns.length; i++) {
5
if (word.contains(patterns[i])) {
6
count++;
7
}
8
}
9
return count;
10
}
11
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0