# 13.09.2025 [3541. Find Most Frequent Vowel and Consonant]
Max freq vowels + consonants #easy
13.09.2025
3541. Find Most Frequent Vowel and Consonant easy blog post substack youtube
Join me on Telegram
Problem TLDR
Max freq vowels + consonants #easy
Intuition
Make a frequency array, then find max of vowel and max of consonant.
Approach
can we do a one-liner?
Complexity
Time complexity: $$O(n)$$
Space complexity: $$O(n)$$
Code
// 27ms
fun maxFreqSum(s: String) = s.partition { it in "aeiou" }.toList()
.sumOf { it.groupBy { it }.maxOfOrNull { it.value.size } ?: 0 }


