Skip to content

Practice Find Most Frequent Vowel and Consonant

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#3541
LeetCode Problem

Find Most Frequent Vowel and Consonant

Problem Statement

Given the lowercase string s, find the largest frequency among vowels a, e, i, o, u and the largest frequency among all other letters. Use 0 for a group with no characters in s. Return the sum of these two frequencies.

Source: Find Most Frequent Vowel and Consonant on LeetCode. Use the original task for its coding environment and submissions.

Examples

# 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.

Related LeetCode Problems

Practice more problems similar to Find Most Frequent Vowel and Consonant.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.