From ed3d1ee6ccdab447ee133341ee147e8afd3dc00d Mon Sep 17 00:00:00 2001 From: ing-eoking Date: Tue, 1 Apr 2025 20:32:17 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20Study:=20=EC=98=AC=EB=B0=94?= =?UTF-8?q?=EB=A5=B8=20=EA=B4=84=ED=98=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...254\353\260\224\353\245\270 \352\264\204\355\230\270.py" | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 "\354\230\254\353\260\224\353\245\270 \352\264\204\355\230\270.py" 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