Skip to content

Commit 242fbf3

Browse files
authored
Create remove-vowels-from-a-string.py
1 parent 5f76b76 commit 242fbf3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Python/remove-vowels-from-a-string.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Time: O(n)
2+
# Space: O(1)
3+
4+
class Solution(object):
5+
def removeVowels(self, S):
6+
"""
7+
:type S: str
8+
:rtype: str
9+
"""
10+
lookup = set("aeiou")
11+
return "".join(c for c in S if c not in lookup)

0 commit comments

Comments
 (0)