text. The vowels are the letters a, e, i, o and u in either case.
Reverse the order of all the vowels in the string: the first vowel trades places with the last, the second with the second to last, and so on. All other characters keep their positions, and each vowel keeps its own case as it moves. Return the resulting string.text='Orange juice' → 'eringu jeacO'
The vowels in order are O a e u i e. Reversed they are e i u e a O, placed back into the same slots: eringu jeacO.
text='rhythm' → 'rhythm'
There are no vowels, so the string stays the same.
text='aUtO' → 'OUta'
The vowels a U O become O U a; the consonant t stays put: OUta.
text.length ≤ 3 · 10⁵text consists of printable ASCII characterstext='Orange juice'
'eringu jeacO'
Run checks the first 3 tests in your browser. Submit checks all 5 tests on the server, hidden ones included.