1. 程式人生 > >345. Reverse Vowels of a String(交換元音字母)(leetcode)

345. Reverse Vowels of a String(交換元音字母)(leetcode)

alt not in 分享 clu input hello png div hat

Write a function that takes a string as input and reverse only the vowels of a string.

Example 1:

Input: "hello"
Output: "holle"

Example 2:

Input: "leetcode"
Output: "leotcede"

Note:
The vowels does not include the letter "y".

技術分享圖片

345. Reverse Vowels of a String(交換元音字母)(leetcode)