Coding Trainer
Subarray Sum Equals K
Problem
Given an array nums and integer k, return the total number of subarrays whose sum equals k.
Example:
nums = [1,1,1], k = 2 → 2
nums = [1,2,3], k = 3 → 2 // [1,2] and [3]