LEETCODE · TWO-POINTER TECHNIQUES

Minimum Size Subarray Sum

leetcode-209
Minimum Size Subarray Sum

Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 instead.

input:nums =[2,3,1,2,4,3]target = 7
output: 2
· 1 <= nums.length <= 10^5
· all nums[i] > 0