Tap here to switch tabs
Problem
Submissions

Problem: Reverse Vowels of a String

easy
15 min
Explore how to apply the two pointers approach to reverse vowels in a string, including both lowercase and uppercase vowels. Understand the problem constraints, implement an efficient solution, and practice with a coding playground to reinforce your skills.

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.

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths
Tap here to switch tabs
Problem
Submissions

Problem: Reverse Vowels of a String

easy
15 min
Explore how to apply the two pointers approach to reverse vowels in a string, including both lowercase and uppercase vowels. Understand the problem constraints, implement an efficient solution, and practice with a coding playground to reinforce your skills.

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.

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths