Skip to content

Commit 1e9f9a9

Browse files
committed
Removing Stars from a string
1 parent f8ff7fa commit 1e9f9a9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

2024/removing_stars_from_a_string.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution(object):
2+
def removeStars(self, s):
3+
chars = []
4+
5+
for char in s:
6+
if char is not '*':
7+
chars.append(char)
8+
else:
9+
chars.pop()
10+
return "".join(chars)

0 commit comments

Comments
 (0)