diff --git "a/\354\230\254\353\260\224\353\245\270 \352\264\204\355\230\270.py" "b/\354\230\254\353\260\224\353\245\270 \352\264\204\355\230\270.py" new file mode 100644 index 0000000..286eab0 --- /dev/null +++ "b/\354\230\254\353\260\224\353\245\270 \352\264\204\355\230\270.py" @@ -0,0 +1,6 @@ +def solution(s: str) -> bool: + cur = 0 + for i in s: + cur += (i == '(') - (i == ')') + if cur < 0: return False + return cur == 0