leetle

Daily challenge for 2026-03-18

442. Smallest Range Containing Target

Given a sorted array of integers nums and a target integer target, find the length of the smallest contiguous subarray that contains the target value at least once. If the target is not in the array, return 0.

Example:
Input: nums = [1, 2, 4, 4, 7], target = 4 Output: 1 (since the single element [4] contains the target).

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