You are given a string `s` of lowercase English letters. The vowels are 'a', 'e', 'i', 'o' and 'u'; every other letter is a consonant. Find the highest frequency of any single vowel and the highest frequency of any single consonant, and return their sum. If the string has no vowels (or no consonants), that part counts as 0.
You are given a string s of lowercase English letters. The vowels are 'a', 'e', 'i', 'o' and 'u'; every other letter is a consonant. Find the highest frequency of any single vowel and the highest frequency of any single consonant, and return their sum. If the string has no vowels (or no consonants), that part counts as 0.
Example 1:
Input: {"s":"successes"}
Output: 6
Constraints:
1≤s.length≤100
s consists of lowercase English letters only.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"s":"successes"}
Make 26 empty buckets, one per letter: a, e, i, o, u go on the vowel shelf, the other 21 on the consonant shelf.