문제출처: https://programmers.co.kr/learn/courses/30/lessons/12973
접근법
코드 def solution(s): stack = [] for ch in s: if( stack and ch == stack[-1] ): stack.pop(-1) else: stack.append(ch) return 0 if stack else 1
def solution(s): stack = [] for ch in s: if( stack and ch == stack[-1] ): stack.pop(-1) else: stack.append(ch) return 0 if stack else 1