209. Minimum Size Subarray Sum

Practice Minimum Size Subarray Sum for free on NudgeCode: Medium, Sliding Window pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

Given positive integers nums and a positive target, return the length of the shortest contiguous subarray whose sum is at least target. Return 0 if no such subarray exists.

Example

target = 7, nums = [2,3,1,2,4,3]  ->  2   ([4,3])

Constraints