Tap here to switch tabs
Problem
Submissions

Problem: Reverse Vowels of a String

Reverse Vowels of a String asks you to return the input string with its vowels in reverse order, including both lowercase and uppercase vowels, while every non-vowel character remains in place.

Statement

Given a string s, reverse only the vowels in the string and return the resulting string.

The vowels are ‘a’, ‘e’, ‘i’, ‘o’, and ‘u’, and they can appear in both lowercase and uppercase, potentially more than once.

Constraints:

  • 1 ≤ s.length ≤ 3 × 105

  • s consists of printable ASCII characters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Reverse Vowels of a String

Reverse Vowels of a String asks you to return the input string with its vowels in reverse order, including both lowercase and uppercase vowels, while every non-vowel character remains in place.

Statement

Given a string s, reverse only the vowels in the string and return the resulting string.

The vowels are ‘a’, ‘e’, ‘i’, ‘o’, and ‘u’, and they can appear in both lowercase and uppercase, potentially more than once.

Constraints:

  • 1 ≤ s.length ≤ 3 × 105

  • s consists of printable ASCII characters.