Ezvor

1966. Binary Searchable Numbers in an Unsorted Array

MediumArray Preparing judge… LeetCode
ArrayBinary SearchStackMonotonic Stack

Hints

Hint 1
The target will not be found if it is removed from the sequence. When does this occur?
Hint 2
If a pivot is to the left of and is greater than the target, then the target will be removed. The same occurs when the pivot is to the right of and is less than the target.
Hint 3
Since any element can be chosen as the pivot, for any target NOT to be removed, the condition described in the previous hint must never occur.