Reverse Vowels of a String

Given string *s*, reverse only the vowels of *s* (case-sensitive). Return the resulting string. Use a two-pointer approach.

Input Format

One line string s.

Output Format

Reversed-vowels string.

Constraints

  • 0 <= len(s) <= 10^5; only English letters.

Examples

Example 1:

Input:

s = "hello"

Output:

holle

Explanation:

Vowels 'e' and 'o' are reversed.

Loading...
Reverse Vowels of a String - Strings DSA Problem