#C8964. Reverse Vowels
Reverse Vowels
Reverse Vowels
Given a string s, reverse only the vowels in it without changing the positions of the other characters. The vowels are defined as \(a, e, i, o, u\) along with their uppercase variants.
For example, if s is "hello world", the output should be "hollo werld". The solution should read from the standard input (stdin) and write the result to the standard output (stdout). You can use a two-pointer approach for an efficient solution.
inputFormat
The input consists of a single line containing the string s. The string may contain spaces, punctuation, and both uppercase and lowercase letters.
outputFormat
Output a single line which is the string s with its vowels reversed.
## samplehello world
hollo werld
</p>