Skip to content

22. Generate Parentheses#42

Open
ryosuketc wants to merge 1 commit intomainfrom
22_generate_parentheses
Open

22. Generate Parentheses#42
ryosuketc wants to merge 1 commit intomainfrom
22_generate_parentheses

Conversation

@ryosuketc
Copy link
Copy Markdown
Owner

all_parentheses = []

def backtrack(parentheses, opening, closing):
if len(parentheses) == 2 * n:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

下の二つの条件式に合わせて、'if opening == n and closing == n' のように opening, closing を使って判定してもいいですね。


### step3

* TODO: もうちょっと他の人の回答を読み込みたいが、時間切れ。。一旦 review 出します。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

olsen-blue/Arai60#54 (comment)
自分はこの解法に感動したので共有です。

@ryosuketc ryosuketc added the need re-review Review comments are lightly examined and re-review of the problem is needed. label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need re-review Review comments are lightly examined and re-review of the problem is needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants