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 …

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.

Already a paid subscriber? Sign in
© 2025 Harpreet Singh · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture