Subarray Sum Equals K

Medium

📝 Description

Find the total number of continuous subarrays whose sum equals to k

Input Format

Array of integers and integer k

Output Format

Integer count

Constraints

1 ≤ nums.length ≤ 2 * 10^4 -1000 ≤ nums[i] ≤ 1000

🔍 Sample Input

[1,1,1]
2
            

✅ Sample Output

2
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run