You are given a string s consisting of lowercase English letters ('a' to 'z').
Your task is to:
Return the sum of the two frequencies.
Note: If multiple vowels or consonants have the same maximum frequency, you may choose any one of them. If there are no vowels or no consonants in the string, consider their frequency as 0.
Examples
Example 1
Input: s = "successes"
Output: 6
Explanation:
Example 2
Input: s = "aeiaeia"
Output: 3
Explanation:
Constraints
1 <= s.length <= 100
s consists of lowercase English letters only.
3541. Find Most Frequent Vowel and Consonant
Easy
10 Points
Hash Table
String
Counting
You are given a string s consisting of lowercase English letters ('a' to 'z').
Your task is to:
Return the sum of the two frequencies.
Note: If multiple vowels or consonants have the same maximum frequency, you may choose any one of them. If there are no vowels or no consonants in the string, consider their frequency as 0.
Examples
Example 1
Input: s = "successes"
Output: 6
Explanation:
Example 2
Input: s = "aeiaeia"
Output: 3
Explanation:
Constraints
1 <= s.length <= 100
s consists of lowercase English letters only.
Find Most Frequent Vowel and Consonant - Practice Coding | SlaveCode