-
-
Notifications
You must be signed in to change notification settings - Fork 49.5k
Closed
Description
Python/data_structures/stacks/balanced_parentheses.py
Lines 13 to 17 in 6a95bf9
| 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.
| from .Stack import Stack |
there is no module named .Stack. it should be
from stack import Stack
Metadata
Metadata
Assignees
Labels
No labels