Given a sequence of integers and a target sum, determine the count of contiguous subsequences within the sequence where the sum of elements equals the target sum.
Explanation: The subsequences [2, 3] and [5] sum up to the target value of 5.
Explanation: The subsequences [1, 1, 1], [1, 1, 1], and [1, 1, 1] sum up to the target value of 3.
Count subarrays with given sum using prefix
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak