Loading repovive.com/problems/classics/45
Given an array of integers and a target value , count the number of non-empty contiguous subarrays whose sum is exactly .
There are four contiguous subarrays with total 3: positions 1..2, 2..3, 3..4, and 4..5.
Every non-empty contiguous subarray has total 0, so all 10 subarrays count.
The six qualifying segments are 1..2, 1..4, 1..6, 2..5, 4..4, and 4..6.