Skip to content

Conversation

@docto-rin
Copy link
Owner

if use_flag & bit:
subset.append(nums[index])
index += 1
bit <<= 1

Choose a reason for hiding this comment

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

for のループインデックスを使うのもよさそうかなと思いましたが、このように bit <<=1 していった方が全体としてビット操作をしている感じがしていいなと思いました。


## Step 3

[実装2](#実装2)、[実装4](#実装4)あたりを確認した。

Choose a reason for hiding this comment

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

問題ないと思います。他の人が書いたコードを読んでみるのもやってみると良いと思います。


#### 実装5-3

- 修正案その2:map のデフォルト引数で束縛
Copy link

Choose a reason for hiding this comment

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

map というか lambda ですね。
Python は、スコープを作るのが関数くらいです。
私はこのあたりでデフォルト引数で固定するイディオムを知りました。
https://discord.com/channels/1084280443945353267/1339428945845555252/1381993770840756226

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.

5 participants