programmers | Lv2. 짝지어 제거하기 [Python]

yeonk·2022년 3월 14일
0

algorithm

목록 보기
72/88
post-thumbnail

💡 Python 3






🔗 문제

짝지어 제거하기 [Link]






💻 코드

def solution(s):
    check = []
    for i in s:
        if check == []: check.append(i)
        elif check[-1] == i: check.pop()
        else: check.append(i)
    return 0 if len(check) >= 1 else 1

0개의 댓글