나의 풀이
def solution(s):
tmp = []
for i in s:
if i == '(':
tmp.append(i)
elif i == ')' and any(tmp):
tmp.pop()
else:
return False
return not any(tmp)
'코딩 테스트 (Coding Test)' 카테고리의 다른 글
[프로그래머스] 숫자의 표현 (0) | 2023.01.16 |
---|---|
[프로그래머스] 이진 변환 반복하기 (0) | 2023.01.16 |
[프로그래머스] JadenCase 문자열 만들기 (0) | 2023.01.16 |
[프로그래머스] 키패드 누르기 (0) | 2023.01.13 |
[프로그래머스] **2021 카카오 신규 아이디 추천 (0) | 2023.01.11 |