```
public class Solution {
public int minSubArrayLen(int s, int[] nums) {
int ans = Integer.MAX_VALUE;
int j = 0;
int sum = 0;
for(int i = 0; i < nums.length; i++){
while(j < nums.length && sum < s){
sum += nums[j];
j++;
}
if(sum >= s){
ans = Math.min(ans, j - i);
}
sum = sum - nums[i];
}
if(ans == Integer.MAX_VALUE){
return 0;
}
return ans;
}
}
```

This is O(N) or O(N * N)?