1119. Remove Vowels from a String
Given a string S
, remove the vowels 'a'
, 'e'
, 'i'
, 'o'
, and 'u'
from it, and return the new string.
Example 1:
Example 2:
Note:
S
consists of lowercase English letters only.1 <= S.length <= 1000
解题要点:
先设一个含有元音的set,遍历字符串,把不是元音的字符加到新string里,返回它。
Last updated
Was this helpful?