Minimum Size Subarray Sum
All items of nums are positive. Find the shortest contiguous stretch whose sum is at least target, and return its length.
Return 0 if no stretch is big enough.
Example 1
target 7
nums [2,3,1,2,4,3]
returns 2
The stretch [4, 3] sums to 7.
Example 2
target 100
nums [1,2,3]
returns 0
Even the whole list is too small.
Constraints
1 <= len(nums) <= 301 <= nums[i] <= 201 <= target <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.