Back to problems

Search in Rotated Sorted Array

Algorithm · ByteDance · Medium

Search in Rotated Sorted Array Medium · Array, Binary Search · Facebook, Amazon, Microsoft, Bloomberg · Hints: 1. Determine which half of the array is strictly increasing by comparing the middle element with the leftmost element. Once the sorted half is identified, check whether target falls inside its bounds; if so, continue searching that half, else search the opposite half. When duplicates may be present and nums[left] == nums[mid] == nums[right], shrink the search…

Checking your access…