Reverse Vowels of String Problem

Reverse Vowels of String Problem — ExecCode Easy DSA Practice

Solve the Reverse Vowels of String problem on ExecCode. Free online easy DSA practice in Two Pointers. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a string s, reverse only all the vowels in the string and return it. Your task is to the vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once. Return the required answer exactly as shown in the examples.

Examples

Input {"s": "hello"}; Output holle. Input {"s": "leetcode"}; Output leotcede. Input {"s": "aA"}; Output Aa

Constraints

1 <= s.length <= 3 * 10^5 s consist of printable ASCII characters.

Practice Reverse Vowels of String free on ExecCode. Browse DSA problems, topic map, and placement guides.