Given an array of integers, find the number of contiguous subarrays where the sum of the elements equals a given target value.
Explanation: The subarrays [2, 3] and [5] sum up to the target value 5.
Explanation: There is no contiguous subarray that sums up to the target value 60.
Explanation: The subarray [5, 5, 5] sums up to the target value 15.
Count subarrays with given sum using prefix
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak