Count Of Subarrays Having Sum Equals To K
medium
1. You are given an array of integers(arr) and a number K. 2. You have to find the count of subarrays whose sum equals k.
Constraints
1 <= N <= 10^5 -1000 <= arr[i] <= 1000 -10^9 <= K <= 10^9
Format
Input
A number N arr1 arr2.. N numbers A number K
Output
A number representing the count of subarrays having sum equal to K.
Example
Sample Input
3
1 1 1
2
Sample Output
2
Question Video