Given an array of positive integers nums and a positive integer target, return the smallest length of a contiguous subarray whose sum is at least target.
Return 0 when no qualifying subarray exists.
Inputtarget = 7, nums = [2, 3, 1, 2, 4, 3]
Output2
The adjacent values 4 and 3 add up to 7. Every single value is below 7, so the shortest qualifying subarray has length 2.
Inputtarget = 4, nums = [1, 4, 4]
Output1
A single 4 already reaches the target, so the minimum length is 1.
1 ≤ nums.length ≤ 100,000