← All problemsSign in

3913. Sort Vowels by Frequency

LeetCodeStringSortingCountingOpen on judge ↗

You are given a string s consisting of lowercase English characters. Rearrange only the vowels in the string so that they appear in non-increasing order of their frequency. If multiple vowels have the same frequency, order them by the position of their first occurrence in s. Return the modified string. Vowels are 'a', 'e', 'i', 'o', and 'u'. The frequency of a letter is the number of times it

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start