|
stack.push(parenthesis) |
|
elif parenthesis == ')': |
|
stack.pop() |
|
return not stack.is_empty() |
|
|
Line 16 returns wrong result due to not
Line 15 can cause error for inputs like )). before calling pop it should be checked if stack is empty.
there is no module named .Stack. it should be
from stack import Stack
Python/data_structures/stacks/balanced_parentheses.py
Lines 13 to 17 in 6a95bf9
Line 16returns wrong result due tonotLine 15can cause error for inputs like )). before calling pop it should be checked if stack is empty.Python/data_structures/stacks/balanced_parentheses.py
Line 3 in 6a95bf9
there is no module named .Stack. it should be
from stack import Stack