leetle

Daily challenge for 2026-03-02

426. Find Smallest Element Index

Given a sorted array of integers nums which is rotated at some unknown pivot point (e.g., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Your task is to find the index of the smallest element in this array. You must write an algorithm with $O(\log n)$ runtime complexity, utilizing binary search.

Example:
Input: nums = [4,5,6,7,0,1,2]
Output: 4 (The smallest element 0 is at index 4)

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