Exercises/#61 Search in Rotated Sorted Array
#61

Search in Rotated Sorted Array

MediumπŸ” Sorting & Searching
80 XP

Problem

Given a rotated sorted array with no duplicates, search for a target value. Return its index or -1.

Examples

Input: nums=[4,5,6,7,0,1,2], target=0
Output: 4

Input: nums=[4,5,6,7,0,1,2], target=3
Output: -1
binary-searcharray
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

61 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features