Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

整体思路刚好与 searchLeft 相反,为收缩左边届 ——

方法二:利用 leftBound

上一题的 searchLeft 中其实隐含了一个「找到 >= target 的最小索引」的方案(称为 leftBound

...