A call center records the number of calls received in each of n consecutive minutes. A "surge window" is any block of exactly k consecutive minutes whose total call count is at least t. Count how many surge windows occur.
Line 1: three integers n, k, and t.
Line 2: n space-separated non-negative integers, the per-minute call counts.
A single integer: the number of length-k windows whose sum is at least t.
Example 1
Input
5 2 5 3 1 4 1 5
Expected
3
Explanation
The 2-minute window sums are 4, 5, 5, 6. Three of them (5, 5, 6) reach the threshold 5.
Example 2
Input
3 2 100 1 1 1
Expected
0
Explanation
Both 2-minute windows sum to 2, which is below 100, so no surge window occurs.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →