Reverse only the vowels, leaving every consonant exactly where it is. Same converging
two-pointer shape as Reverse String, but each side first skips forward past anything
that isn't a vowel.
Execution
idle
Press Run to begin.
0 / 0
Speed
Java · running line
pointers on a vowelswappingdoneconsonant (untouched)
O(n) time · O(1) extra space (excluding the output string) · consonants never move — only their positions get skipped over.