Skip to content
Discussion options

You must be logged in to vote

We need to find the sum of the maximum frequency of a vowel and the maximum frequency of a consonant in a given string. The solution involves counting the occurrences of each character, categorizing them as vowels or consonants, and then determining the highest frequency in each category.

Approach

  1. Define Vowels: Identify the vowels as 'a', 'e', 'i', 'o', and 'u'.
  2. Count Frequencies: Use an associative array to count how many times each character appears in the string.
  3. Separate Vowels and Consonants: Iterate through the frequency array, separating the counts into vowels and consonants.
  4. Find Maximum Frequencies: Determine the highest frequency among the vowels and the highest among the cons…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kovatz
Comment options

kovatz Sep 13, 2025
Collaborator

@mah-shamim
Comment options

mah-shamim Sep 13, 2025
Maintainer Author

Answer selected by kovatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested easy Difficulty
2 participants