017 Vowels match

Tech In Pieces發表於2020-12-22

given an string s. and another string called pattern,
for example, s = amazing pattern=“010”
0 means there should be vowel and 1 means there is not
calculate the number of substring of s that meets the given pattern.
return the number.

note: a e i o u y count as vowels.

like one of those string matching algorithm, the time complexity for this will be O(n-m) where n is the length of s and m is the length of pattern

相關文章