Class Solution
-
- All Implemented Interfaces:
public final class Solution3306 - Count of Substrings Containing Every Vowel and K Consonants II.
Medium
You are given a string
wordand a non-negative integerk.Return the total number of substrings of
wordthat contain every vowel ('a','e','i','o', and'u') at least once and exactlykconsonants.Example 1:
Input: word = "aeioqq", k = 1
Output: 0
Explanation:
There is no substring with every vowel.
Example 2:
Input: word = "aeiou", k = 0
Output: 1
Explanation:
The only substring with every vowel and zero consonants is
word[0..4], which is"aeiou".Example 3:
Input: word = "ieaouqqieaouqq", k = 1
Output: 3
Explanation:
The substrings with every vowel and one consonant are:
word[0..5], which is"ieaouq".word[6..11], which is"qieaou".word[7..12], which is"ieaouq".
Constraints:
<code>5 <= word.length <= 2 * 10<sup>5</sup></code>
wordconsists only of lowercase English letters.0 <= k <= word.length - 5
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
Modifier and Type Method Description final LongcountOfSubstrings(String word, Integer k)-
-
Method Detail
-
countOfSubstrings
final Long countOfSubstrings(String word, Integer k)
-
-
-
-