Skip to content

Proper parenthetics#3

Open
serashioda wants to merge 12 commits into
masterfrom
proper-parenthetics
Open

Proper parenthetics#3
serashioda wants to merge 12 commits into
masterfrom
proper-parenthetics

Conversation

@serashioda
Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/parenthetics.py
def parenthetics(uni_string):
"""Take unicode string as input and return value."""
stack = Stack()
charac_array = list(uni_string)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why turn this into a list if strings are iterable in both Python 2 and 3?

Comment thread src/parenthetics.py
stack.pop()
if stack.size() == 0:
return 0
elif stack.size() > 0:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this elif

PAREN_TABLE = [
['((()))', 0],
['((())', 1],
[')))(((', -1]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need more test cases.

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.

2 participants