문제링크: 짝지어 제거하기
✍🏻 Information
| content | |
|---|---|
| 언어 | python |
| 난이도 | ⭐️+0.5 |
| 풀이시간 | 3분 |
| 제출횟수 | 1 |
| 인터넷검색유무 | no |
🍒 My Code
def solution(s):
stack = []
for i in s:
if len(stack)!=0 and stack[-1]==i:
stack.pop()
else:
stack.append(i)
return 1 if len(stack)==0 else 0
💡 What I learned