Skip to content

Conversation

Satorien
Copy link
Owner


## Step 3. Final Solution

- シンプルな実装に落ち着いた
Copy link

Choose a reason for hiding this comment

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

探す値が変わるのは二分探索っぽくないないように感じました。

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

@fuga-98 fuga-98 Aug 14, 2025

Choose a reason for hiding this comment

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

別のところで講師の方されていた質問です。考えてみると理解が深まるかもしれません!

  1. 「2で割る処理がありますがこれは切り捨てでも切り上げでも構わないのでしょうか。」
  2. 「nums[middle] <= nums[right] とありますが、これは < でもいいですか。」
  3. 「nums[right] は、nums[-1] でもいいですか。」
  4. 「right の初期値は nums.size() でもいいですか。」

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.

2 participants