Given an array of positive integers and a target sum, find the length of the shortest contiguous subarray whose sum is at least the target. Return 0 if no such subarray exists.
Example 1
Explanation: The subarray [4,3] (indices 4-5) sums to 7 with length 2 — the shortest qualifying subarray.
Example 2
Explanation: No subarray's sum ever reaches 100, so 0 signals that no qualifying subarray exists.
Example 3
Explanation: Only the entire array sums to at least 4, so the shortest — and only — qualifying subarray is the whole thing.
Code execution is coming soon.