Number of contiguous subsequences summing to a given target
-
05-11-2019 - |
题
I could not figure out an efficient way (better than $O(n^2)$) to count the number of contiguous subsequences of an array of both positive and negative integers summing up to a given number $k$.
For example, if $A = \{2,5,6,-1\}$ and $k = 5$ then the answer is $2$, since both $5$ and $6,-1$ sum to $5$.
没有正确的解决方案
不隶属于 cs.stackexchange