Harpreet's Newsletter

Harpreet's Newsletter

Search in Rotated Sorted Array

Google Interview Question

Harpreet Singh's avatar
Harpreet Singh
Nov 14, 2025
∙ Paid

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 …

User's avatar

Continue reading this post for free, courtesy of Harpreet Singh.

Or purchase a paid subscription.
© 2026 Harpreet Singh · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture