# [leetcode]209. Minimum Size Subarray Sum[存疑]

class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
int n=nums.size();
int i=0;
int j=0;
int sum=0;
int len=nums.size()+1;
while(i<n&&j<n)
{
while(sum<s&&j<n)
{
sum+=nums[j];
j++;
}
while(sum>=s&&i<=j)
{
len=min(len,j-i);

sum-=nums[i];
i++;
}

}
return len!=(nums.size()+1)? len:0;
}
};

#### LeetCode 209 - Minimum Size Subarray Sum

2015-05-12 12:50:20

#### leetcode 209 : Minimum Size Subarray Sum

2015-05-14 06:15:11

#### LeetCode 209. Minimum Size Subarray Sum（最小子数组之和）

2016-05-04 13:17:10

#### leetcode 209. Minimum Size Subarray Sum-子序列最小长度|双指针|二分查找

2016-06-13 22:14:10

#### leetcode209-Minimum Size Subarray Sum(最小长度子数组和)

2016-01-25 23:15:37

#### 209. Minimum Size Subarray Sum（很重要）

2016-08-12 22:53:47

#### [leetcode]209. Minimum Size Subarray Sum@Java解题报告

2018-03-04 21:37:04

#### [leetcode-209]Minimum Size Subarray Sum(java)

2015-08-26 14:01:30

#### [LeetCode325] Maximum Size Subarray Sum Equals k

2016-01-08 15:34:02

#### LeetCode 325. Maximum Size Subarray Sum Equals k（和为k的最长子数组）

2016-04-26 06:10:18