Given an array of integers, find the number of subarrays whose sum equals a given target value.
Explanation: The subarrays [2, 3] and [5] have a sum equal to the target value 5.
Explanation: The subarray [10, 20, 30] has a sum equal to the target value 60.
Count subarrays with given sum using prefix
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak