Your question is Arrays and Hashmaps Coding. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Gro Intelligence's Data API can provide ordered daily climate anomaly values for a region. Given these values and a target total, count how many contiguous periods have a sum exactly equal to the target.
Values may be positive, negative, or zero. Two periods are different if they have different start or end indices.
Implement count_target_windows(values, target).
values is a list of integers representing ordered daily anomaly values.target is an integer total.target.def count_target_windows(values, target):