loading…
Given positive integers, write min_sub_len(target, nums) that returns the length of the shortest contiguous subarray whose sum is >= target, or 0 if there is none.
min_sub_len(7, [2, 3, 1, 2, 4, 3]) -> 2 # [4, 3]
Stuck on the idea itself? The sliding window lesson walks through the pattern from scratch.