What would be a divide-and-conquer algorithm to check if there’s a subarray say A[i : j]
of A such that A[i] + . . . + A[j] = target value
. What would be a good way to go about designing an algorithm like this that would print out the indices of the sub-array?
The elements in the array are signed, i.e. both positive and negative values are allowed.