Skip to content

Create 46. Permutations.md#49

Open
fuga-98 wants to merge 1 commit into
mainfrom
46.-Permutations
Open

Create 46. Permutations.md#49
fuga-98 wants to merge 1 commit into
mainfrom
46.-Permutations

Conversation

@fuga-98
Copy link
Copy Markdown
Owner

@fuga-98 fuga-98 commented May 20, 2025

Comment thread 46. Permutations.md
def permute_helper(takeover_nums, rest_nums):
assert rest_nums is not None
if not rest_nums:
return [takeover_nums]
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 takeover_nums にして result に append でもいいのではないでしょうか?

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.

レビューありがとうございます。
128行目がList[List[int]] を返すので、型の整合性が取れなくなってしまいます。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

なるほどです。ありがとうございます。

Comment thread 46. Permutations.md
Comment on lines +25 to +27
for num in nums:
stack.append([num])
for i in range(1, len(nums)):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

これでいきませんか?

stack.append([])
for i in range(len(nums)):

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.

行けました。今見返すと変なことをしていますね。

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