因此,对于下面的数组,其中L = 3
So for the following array, where L = 3
-5 -1 2 -3 0 -3 3
至少长3所述的最好的可能的总和将是0,其中子序列是最后三要素(0,-3,3)
The best possible sum of at least length 3 would be 0, where the subsequence is the last three elements (0, -3, 3)
您如何计算比O(NL)更快的这笔钱用于任何阵列(有效O(N ^ 2)如果L == 0)的时间?
How can you calculate this sum for any array in faster than O(NL) (effectively O(N^2) if L==0) time?
我相信,你可以在O(n)的时间通过使用的