Here is the problem statement:
Given an array A[1..n]. Find the sub-array that it's sum is smallest and at least M. (all numbers in the input is 32bit integer)
Till now I cannot find a good solution. Can anyone help me with an O(n) or O(NlogN) algorithm?