给一个数组和一个target, 找有没有subarray的和为target
[Solution]
全是正数/负数:cumulative sum + two pointer window
有正有负:Cumulative Sum + Two Sum
[Note]
正负数的时候cumulative sum不是递增的
两种情况都要先计算cumulative sum,即使全正/全负也不代表数组就是sorted的,不能直接two points.
[Time Space]
O(n) time, O(n) space
Read full article from Google-Subarray Sum to Target