Search in Rotated Sorted Array
Google Interview Question
Problem Overview
Difficulty: Medium
LeetCode Pattern: Binary Search
You are given a sorted array of distinct integers nums. The array may be rotated at an unknown index.
For example, [0,1,2,4,5,6,7] might be left rotated by 3 indices and become [4,5,6,7,0,1,2].
Given a target value, return its index if it exists in the array, otherwise return -1.
Note: Your …
Keep reading with a 7-day free trial
Subscribe to Harpreet's Newsletter to keep reading this post and get 7 days of free access to the full post archives.

