Skip to content

Commit

Permalink
Merge pull request #21 from AlgoLeadMe/6-suhyun113
Browse files Browse the repository at this point in the history
6-suhyun113
  • Loading branch information
suhyun113 committed Jul 6, 2024
2 parents cddf510 + 8974a68 commit 0fbbc2b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion suhyun113/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
| 2์ฐจ์‹œ | 2024.03.29 | ์ˆ˜ํ•™ | [์†Œ์ˆ˜ & ํŒฐ๋ฆฐ๋“œ๋กฌ](https://www.acmicpc.net/problem/1747) | [#9](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/9) |
| 3์ฐจ์‹œ | 2024.04.02 | ๊ทธ๋ฆฌ๋”” | [๊ฑฐ์Šค๋ฆ„๋ˆ](https://www.acmicpc.net/problem/14916) | [#12](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/12) |
| 4์ฐจ์‹œ | 2024.04.06 | DP | [ํ”ผ๋ณด๋‚˜์น˜ ์ˆ˜ 5](https://www.acmicpc.net/problem/10870) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/16) |
| 5์ฐจ์‹œ | 2024.04.10 | ์Šคํƒ | [ํฌ๋ ˆ์ธ ์ธํ˜• ๋ฝ‘๊ธฐ ๊ฒŒ์ž„](https://school.programmers.co.kr/learn/courses/30/lessons/64061) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/19) |
| 5์ฐจ์‹œ | 2024.04.10 | ์Šคํƒ | [ํฌ๋ ˆ์ธ ์ธํ˜• ๋ฝ‘๊ธฐ ๊ฒŒ์ž„](https://school.programmers.co.kr/learn/courses/30/lessons/64061) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/19) |
| 6์ฐจ์‹œ | 2024.04.14 | ์Šคํƒ | [์ปจํŠธ๋กค ์ œํŠธ](https://school.programmers.co.kr/learn/courses/30/lessons/120853) | [#21](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/21) |
20 changes: 20 additions & 0 deletions suhyun113/์Šคํƒ/6-suhyun113.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def solution(s):
answer = 0

stack = [float("inf")]

# ๋ฌธ์ž์—ด์„ ๊ณต๋ฐฑ ๊ธฐ์ค€์œผ๋กœ ๋‚˜๋ˆ„์–ด ๋ฆฌ์ŠคํŠธ์— ์ €์žฅ
s_list = s.split()

for i in s_list: # i๋Š” s_list์˜ ์ธ๋ฑ์Šค๊ฐ€ ์•„๋‹Œ ๊ฐ’
if i != 'Z':
stack.append(i)
else:
stack.pop() # stack์˜ ๊ฐ€์žฅ ์œ„์˜ ๊ฐ’ ๋นผ๊ธฐ
stack.pop(0)

# ๋ฌธ์ž๋ฅผ ์ •์ˆ˜๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ
for i in stack:
n = int(i)
answer += n
return answer

0 comments on commit 0fbbc2b

Please sign in to comment.