#345

Reverse Vowels of a String

pupil · 420 · lc easy +25 · 60.7% accepted · 5,331 likes · top 60%

play →

Description

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

The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.

Code

1
2
3