class Solution {
public int countOfSubstrings(String word, int k) {
int count = 0;
for(int i =0;i<word.length();i++){
HashMap<Character,Integer> map = new HashMap<>();
int consonent = 0;
for(int j = i;j<word.length();j++){
char c = word.charAt(j);
if(c =='a' || c =='e' || c=='i' || c =='o' || c =='u'){
map.put(c,map.getOrDefault(c,0)+1);
}
else consonent++;
if(map.size() ==5 && consonent ==k)count++;
}
}
return count;
}
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)