링크 : 프로그래머스 - 연습문제 > 올바른 괄호
def solution(s): stack = [] for ch in s: if ch == '(': stack.append(ch) elif stack: stack.pop() else: return False return False if stack else True