Skip to content

Solve 20. Valid Parentheses (step 1, 2)#10

Open
cheeseNA wants to merge 2 commits intomainfrom
20
Open

Solve 20. Valid Parentheses (step 1, 2)#10
cheeseNA wants to merge 2 commits intomainfrom
20

Conversation

@cheeseNA
Copy link
Copy Markdown
Owner

return False
if open_bracket_stack.pop() != close_to_open[char]:
return False
return len(open_bracket_stack) == 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.

return not open_bracket_stack でも良いかもしれません。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

なるほど, ありがとうございます!
そちらの方がよりPythonicな気がしますね.

Copy link
Copy Markdown

@nodchip nodchip left a comment

Choose a reason for hiding this comment

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

よいと思います。

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