Skip to content

Conversation

@akmhmgc
Copy link
Owner

@akmhmgc akmhmgc commented Sep 24, 2025

解いた問題

213. House Robber II

使用言語

Ruby

次に解く問題

121. Best Time to Buy and Sell Stock

@akmhmgc akmhmgc added the ruby label Sep 24, 2025

元のメソッド名が`rob`で、円形に並んだ家から盗める最大値を返すことを期待している。
この命名が良いかどうかは置いておいて、変えられないものとして考えると、`rob_xxx`といった名前が良いかもしれない。
`rob_in_line`だと少し情報が少なすぎるか?
Copy link

Choose a reason for hiding this comment

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

再帰で引数が多いだけだと _helper とか _aux とか後ろにつけて、外から呼ぶことを想定していないことをはっきりさせたりします。今回の場合は、ヘルパーとはいえ、できればコードを読んで何が返ってくるのかが分かる状態にしたいですね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants