leetle

Daily challenge for 2025-06-11

162. Find Target in Rotated Sorted Array

Write a function solve that searches for a target value in a rotated sorted array. The array was originally sorted in ascending order, then rotated at some pivot. Return the index if found, otherwise return -1.

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

Run this challenge interactively in Python or JavaScript when the app loads.