Medium
Given an integer array nums and an integer k (passed as target), return the total number of contiguous subarrays whose sum equals k.
nums
k
target
Input: nums = [1,1,1], k = 2 Output: 2
Input: nums = [1,2,3], k = 3 Output: 2