Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Reverse Vowels of a String

XPChallenge Points: 10
levelLevel: Easy

You are given a string s.
Your task is to reverse only the vowels (a, e, i, o, u in both lowercase and uppercase) while keeping all other characters in their original positions.

Return the resulting string after the vowels have been reversed.

Example 1:

Input: s = "Programmer"

Output: "Pregrammor"

Example 2:

Input: s = "HELLOworld"

Output: "HELLOworld"

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result