Just the windowing technique.

```
class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
int sum=0,front=0,back=0,res=INT_MAX;
while(front<nums.size()||sum>=s) {
if(sum<s&&front<nums.size())
sum+=nums[front++];
if(sum>=s) {
res=min(res,front-back);
sum-=nums[back++];
}
}
return res==INT_MAX?0:res;
}
};
```