Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution for issue #36, Valid Parenthesis in python #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Solution for issue #36, Valid Parenthesis in python #164

wants to merge 1 commit into from

Conversation

bpbrum
Copy link

@bpbrum bpbrum commented Oct 24, 2019

Dear the-vampiire,
this is my solution for Issue 36, Valid Parenthesis, in python

Approach / Though Process
From the start, I felt pairwise comparison was the way to go, and indeed it evolved naturally. I decided also to add a test against empty strings right at the beginning to avoid the burden of making all the comparisons if it was supposed to return True anyway. I re-used my "testing" function from the PR for Issue 3, but I feel it could be improved.

Problems during the solution process
As mentioned before, the solutione evolved naturally, and I had basically no problems.

Instructions to run
The file is coded to run the tests on import or open (harcoded into name == "main"), but the function has_valid_parens can be imported for testing. The input is a merely a string.

-- bpbrum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant