《二分查找》 - 二分查找模板 III

https://leetcode.com/explore/learn/card/binary-search/135/template-iii/936/
An alternative way to implement Binary Search
Search Condition needs to access element's immediate left and right neighbors
Use element's neighbors to determine if condition is met and decide whether to go left or right
Gurantees Search Space is at least 3 in size at each step
Post-processing required. Loop/Recursion ends when you have 2 elements left. Need to assess if the remaining elements meet the condition.

1

 搜索条件需要访问元素的直接左右邻居。 使用元素的邻居来确定它是向右还是向左。

1

1

2