Skip to content

Conversation

Satorien
Copy link
Owner

@Satorien Satorien commented Aug 5, 2025

for i in range(1, len(prices)):
if prices[i] < min_buy:
min_buy = prices[i]
continue

Choose a reason for hiding this comment

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

この continue は違う日に売り買いするように書いていると理解しました。これは、max_profit を先に処理することでも可能と思いました。趣味の範囲と思います。

Comment on lines +49 to +50
if len(prices) == 1:
return 0
Copy link

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