leetle

Daily challenge for 2025-08-19

231. Smallest Subarray With Sum At Least S

Write a function solve that returns the length of the smallest contiguous subarray whose sum is at least target. If no such subarray exists, return 0. All numbers are non-negative integers.

Example:
Input: nums = [2,3,1,2,4,3], target = 7
Output: 2 (the subarray [4,3])

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