Problem
Ask
Submissions

Problem: Reverse Vowels of a String

Medium
30 min
Explore how to reverse only the vowels in a string by applying the two-pointer pattern. Understand the problem requirements, manage both uppercase and lowercase vowels, and practice implementing your solution in a coding playground.

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.

Problem
Ask
Submissions

Problem: Reverse Vowels of a String

Medium
30 min
Explore how to reverse only the vowels in a string by applying the two-pointer pattern. Understand the problem requirements, manage both uppercase and lowercase vowels, and practice implementing your solution in a coding playground.

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.