Create 0078-subsets.md - #52
Open
naoto-iwase wants to merge 1 commit into
Open
Conversation
shintaro1993
reviewed
Nov 3, 2025
| if use_flag & bit: | ||
| subset.append(nums[index]) | ||
| index += 1 | ||
| bit <<= 1 |
There was a problem hiding this comment.
for のループインデックスを使うのもよさそうかなと思いましたが、このように bit <<=1 していった方が全体としてビット操作をしている感じがしていいなと思いました。
tokuhirat
reviewed
Nov 3, 2025
|
|
||
| ## Step 3 | ||
|
|
||
| [実装2](#実装2)、[実装4](#実装4)あたりを確認した。 |
There was a problem hiding this comment.
問題ないと思います。他の人が書いたコードを読んでみるのもやってみると良いと思います。
oda
reviewed
Nov 17, 2025
|
|
||
| #### 実装5-3 | ||
|
|
||
| - 修正案その2:map のデフォルト引数で束縛 |
There was a problem hiding this comment.
map というか lambda ですね。
Python は、スコープを作るのが関数くらいです。
私はこのあたりでデフォルト引数で固定するイディオムを知りました。
https://discord.com/channels/1084280443945353267/1339428945845555252/1381993770840756226
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
この問題:https://leetcode.com/problems/subsets/
次の問題:https://leetcode.com/problems/combination-sum/