easyCountingHash TableString 0 views
Find Most Frequent Vowel and Consonant
You are given a string s consisting of lowercase English letters ('a' to 'z').
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.
Example 1
Input: s = "successes"
Output: 6
Example 2
Input: s = "aeiaeia"
Output: 3
Constraints
- 1 <= s.length <= 100
- s consists of lowercase English letters only.
Hints
Companies
No companies reported yet.
Discussion
Sign in to join the discussion.
Loading discussion...
Test results
No test cases yet.