leetle

Daily challenge for 2026-02-25

421. Find Smallest Index in Sorted Array

Given a sorted array of distinct integers nums and a target integer target, find the smallest index i such that nums[i] >= target. If no such index exists (i.e., all elements are smaller than target), return the length of the array. This problem requires finding the lower bound using binary search.

Example:
Input: nums = [1, 3, 5, 6], target = 5
Output: 2

Input: nums = [1, 3, 5, 6], target = 2
Output: 1

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