Skip to content

Create 153. Find Minimum in Rotated Sorted Array.md#42

Open
fuga-98 wants to merge 1 commit into
mainfrom
153.-Find-Minimum-in-Rotated-Sorted-Array
Open

Create 153. Find Minimum in Rotated Sorted Array.md#42
fuga-98 wants to merge 1 commit into
mainfrom
153.-Find-Minimum-in-Rotated-Sorted-Array

Conversation

@fuga-98
Copy link
Copy Markdown
Owner

@fuga-98 fuga-98 commented May 11, 2025


### 追加質問

このソースについて考える。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

この形は全体を無限ループで囲って容易にループに直せますね。

else:
left = mid
return nums[left + 1]
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

このコードの考え方面白いですね。勉強になります。


leftを答えにならない最小の数

rightを答えにならない最大の数とする。
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

言わんとしていることはわかりますが、表現が正確でないような気がします。
「rightを、答えより右にあるとわかっているもののうち最も左の位置とする」とかどうですか?

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.

レビューありがとうございます!
確かにその定義のほうが正確です。

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