mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 23:11:09 +00:00
Update balanced_parentheses.py (#538)
This commit is contained in:
parent
75d11f9034
commit
f1ec84af84
|
@ -6,7 +6,7 @@ __author__ = 'Omkar Pathak'
|
||||||
|
|
||||||
|
|
||||||
def balanced_parentheses(parentheses):
|
def balanced_parentheses(parentheses):
|
||||||
""" Use a stack to check if a string of parentheses are balanced."""
|
""" Use a stack to check if a string of parentheses is balanced."""
|
||||||
stack = Stack(len(parentheses))
|
stack = Stack(len(parentheses))
|
||||||
for parenthesis in parentheses:
|
for parenthesis in parentheses:
|
||||||
if parenthesis == '(':
|
if parenthesis == '(':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user