```
class Solution(object):
def minSubArrayLen(self, s, nums):
"""
:type s: int
:type nums: List[int]
:rtype: int
"""
sumx,start,min_l=0,0,len(nums)+1
for i in range(len(nums)):
sumx+=nums[i]
while sumx>=s:
min_l=min(min_l,i-start+1)
sumx-=nums[start]
start+=1
return 0 if min_l==len(nums)+1 else min_l
```