Search in Rotated Sorted Array II

Medium · Binary Search · about 20 minutes

Asked at Google, Amazon, Microsoft, Bloomberg, LinkedIn, Waymo, D. E. Shaw.

An array sorted in non-decreasing order (duplicates allowed) was rotated at an unknown pivot. Given it and a target, return true if target is in the array.

Related guides