For array [1,2,3,4,5], obviously, there is no sub array whose sum equal 11.
So I think there answer is 0.
consecutive sub array , right ?
@iryan This tripped me too.
The question has a typo it showed as: "Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ? s."
For the ? I assumed it was =. Oh well so much time wasted.
@administrators typo in the description, truly wasted my time
"Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ? s."
Please fix the typo @administrators, so that others may not waste their time like us!