How many k-minute windows beat the target average?
Given a series of readings arr, a window length k, and a threshold, count how many windows of exactly k consecutive readings have an average of at least threshold.
arr = [2, 2, 2, 2, 5, 5, 5, 8], k = 3, threshold = 4
-> 3 # windows [2,5,5], [5,5,5], [5,5,8]
Return the count of qualifying windows. Aim for .
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.