Skip to content

Commit

Permalink
leetcode removing stars from a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas committed Apr 25, 2024
1 parent 97f09a8 commit 00cafe5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions leetcode/algorithms/medium/removing_stars_from_a_string.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Solution:
def removeStars(self, s: str) -> str:
ls = []
for e in s:
if e == "*":
ls.pop()
continue
ls.append(e)
return "".join(ls)

0 comments on commit 00cafe5

Please sign in to comment.