Skip to content

errors in balanced_parentheses.py #620

Closed
@ashwek

Description

@ashwek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions