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.

Input Format

A number N arr1 arr2.. N numbers A number K

Output Format

A number representing the count of subarrays having sum equal to K.

Constraints

1 <= N <= 10^5
-1000 <= arr[i] <= 1000
-10^9 <= K <= 10^9

Example

Input
3
1 1 1
2
Output
2
Previous
Count Of Substrings Having At Most K Unique Characters
Next
Find All Anagrams In A String

Related Questions