Skip to content

Commit a0f8b6f

Browse files
committed
Fix
1 parent 3e30751 commit a0f8b6f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

data_structures/stacks/balanced_parentheses.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ def balanced_parentheses(parentheses: str) -> bool:
1919
for bracket in parentheses:
2020
if bracket in bracket_pairs:
2121
stack.push(bracket)
22-
elif (
23-
bracket in (")", "]", "}")
24-
and stack.is_empty()
25-
or bracket_pairs[stack.pop()] != bracket
26-
):
22+
elif bracket in (")", "]", "}") and (stack.is_empty() or bracket_pairs[stack.pop()] != bracket):
2723
return False
2824
return stack.is_empty()
2925

0 commit comments

Comments
 (0)