Create contiguous subarray with target sum

Idea: such subarray exists <=> accumulated sum at place J = accumulated sum at place I + target, for some J>=I