Tap here to switch tabs
Problem
Submissions

Problem: Count Substrings With Every Vowel and K Consonants II

Count Substrings With Every Vowel and K Consonants II asks you to count substrings containing all five vowels at least once and exactly k consonants.

Statement

You are given a string word and a non negative integer k.

Return the total number of substrings of word that contain every vowel (′a′'a', ′e′'e', ′i′'i', ′o′'o', and ′u′'u') at least once and contain exactly k consonants.

Constraints:

  • 5≤5 \leq word.length ≤2×105\leq 2 \times 10^5

  • word consists only of lowercase English letters.

  • 0≤0 \leq k ≤\leq word.length −5- 5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Substrings With Every Vowel and K Consonants II

Count Substrings With Every Vowel and K Consonants II asks you to count substrings containing all five vowels at least once and exactly k consonants.

Statement

You are given a string word and a non negative integer k.

Return the total number of substrings of word that contain every vowel (′a′'a', ′e′'e', ′i′'i', ′o′'o', and ′u′'u') at least once and contain exactly k consonants.

Constraints:

  • 5≤5 \leq word.length ≤2×105\leq 2 \times 10^5

  • word consists only of lowercase English letters.

  • 0≤0 \leq k ≤\leq word.length −5- 5