The City of Providence processes ordered event values such as permit adjustments or service-request time changes. Given an integer array and a target value, analyze every non-empty contiguous subarray whose elements sum exactly to the target.
Implement a function that returns the number of matching subarrays, the shortest matching length, and the longest matching length. Array values may be negative, zero, or positive, so a sliding-window approach is not valid.
Implement analyze_target_subarrays(nums, target).
nums, a non-empty array of integers, and target, an integer.count: number of contiguous subarrays with sum equal to target.shortest: minimum length among matching subarrays, or 0 if none exist.longest: maximum length among matching subarrays, or 0 if none exist.def analyze_target_subarrays(nums, target):