1119. Remove Vowels from a String
Input: "leetcodeisacommunityforcoders"
Output: "ltcdscmmntyfrcdrs"Input: "aeiou"
Output: ""解题要点:
class Solution(object):
def removeVowels(self, S):
"""
:type S: str
:rtype: str
"""
res = ""
vset = {'a','e','i','o','u'}
for s in S:
if s not in vset:
res += s
return resLast updated