Given a string s, reverse only the vowels in it and return the result. The vowels are 'a', 'e', 'i', 'o' and 'u', in lower or upper case, and they can appear more than once. All other characters stay where they are.
Given a string s, reverse only the vowels in it and return the result. The vowels are 'a', 'e', 'i', 'o' and 'u', in lower or upper case, and they can appear more than once. All other characters stay where they are.
Example 1:
Input: {"s":"IceCreAm"}
Output: AceCreIm
Constraints:
1≤s.length≤3×105
s consists of printable ASCII characters.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"s":"IceCreAm"}
Mark the vowels a, e, i, o, u in both cases. Only these 4 characters will trade places.