#3306

Count of Substrings Containing Every Vowel and K Consonants II

medium · 40.6% accepted · 992 likes · top 20%

hash table · string · sliding window

⊣ practice⊣ open on leetcode ↗

Description

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', 'e', 'i', 'o', and 'u') at least once and exactly k consonants.

Solution