Skip to content

Create 349. Intersection of Two Arrays.md#30

Merged
Mike0121 merged 1 commit intomainfrom
349.-Intersection-of-Two-Arrays
Nov 1, 2025
Merged

Create 349. Intersection of Two Arrays.md#30
Mike0121 merged 1 commit intomainfrom
349.-Intersection-of-Two-Arrays

Conversation

@Mike0121
Copy link
Copy Markdown
Owner

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

戻り値の型が Set[int] になっているように思います。

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.

失礼しました。こちら、python list(set(nums1) & set(nums2))にします。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

この解法が一番よいと思います。

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.

nodchipさん、いつもありがとうございます。
自分も賛成です。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

この解法であれば、set() を使ったほうがシンプルだと思います。

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.

ありがとうございます。そうですね、自分も賛成です。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

merge sort を書くときの書き方を連想しました。

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