We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6d052b commit 18b26b0Copy full SHA for 18b26b0
ing-eoking/올바른 괄호.py
@@ -0,0 +1,6 @@
1
+def solution(s: str) -> bool:
2
+ cur = 0
3
+ for i in s:
4
+ cur += (i == '(') - (i == ')')
5
+ if cur < 0: return False
6
+ return cur == 0
0 commit comments