Skip to content

Conversation

@serashioda
Copy link
Owner

No description provided.

def parenthetics(uni_string):
"""Take unicode string as input and return value."""
stack = Stack()
charac_array = list(uni_string)

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?

stack.pop()
if stack.size() == 0:
return 0
elif stack.size() > 0:

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]

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.

3 participants