Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 1, 2024
1 parent a0f8b6f commit 1e0d57c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data_structures/stacks/balanced_parentheses.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def balanced_parentheses(parentheses: str) -> bool:
for bracket in parentheses:
if bracket in bracket_pairs:
stack.push(bracket)
elif bracket in (")", "]", "}") and (stack.is_empty() or bracket_pairs[stack.pop()] != bracket):
elif bracket in (")", "]", "}") and (
stack.is_empty() or bracket_pairs[stack.pop()] != bracket
):
return False
return stack.is_empty()

Expand Down

0 comments on commit 1e0d57c

Please sign in to comment.