> For the complete documentation index, see [llms.txt](https://emmaguo100.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emmaguo100.gitbook.io/leetcode/01-20-2022-278.md).

# 01/20/2022 278

Use binary search to find the index.

* Time O(logn).
* Space O(1)

![](/files/PlotYGDUksHqGhjQXLmV)
