Created
April 1, 2020 05:06
-
-
Save munguial/4852f9adc81454dbf62a064108cb0687 to your computer and use it in GitHub Desktop.
Leetcode - Remove vowels from string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def removeVowels(self, S: str) -> str: | |
vowels = ['a', 'e', 'i', 'o', 'u'] | |
result = "" | |
for x in S: | |
if x not in vowels: | |
result += x | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment