Virtusa delivery analytics may need to count contiguous windows of event values that meet an exact threshold. Given an integer array and a target, return the number of non-empty contiguous subarrays whose elements sum to the target.
Use an algorithm efficient enough for arrays containing up to 100,000 values. Values may be positive, zero, or negative.
Implement subarray_sum_count(nums, target).
nums, a list of integers, and target, an integer.target.def subarray_sum_count(nums, target):