770. Count of Subarrays with Sum Equals K

0

Hard

Given an array of integers nums and an integer k, determine the total count of continuous subarrays whose sum is equal to k.

Input Format

An input integer n indicating the size of the input array.
Followed by n elements of the input array.
An integer k.

Output Format

The total count of continuous subarrays.

Example

Input

3 1 2 3 3

Output

2

Constraints

1 <= nums.length <= 2 * 10^4
-1000 <= nums[i] <= 1000
-10^7 <= k <= 10^7
Loading...

View Submissions

Console