Skip to content

Commit

Permalink
Merge pull request #15 from AlgoLeadMe/4-pu2rile
Browse files Browse the repository at this point in the history
4-pu2rile
  • Loading branch information
pu2rile authored Jul 3, 2024
2 parents f85a3f1 + e12fa6e commit cddf510
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pu2rile/μŠ€νƒ/제둜.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
k = int(input())
stack = []
for _ in range(k):
n = int(input())
if n == 0:
stack.pop()
else:
stack.append(n)
print(sum(stack))

0 comments on commit cddf510

Please sign in to comment.