Loading...
Loading...
Loading...
A support desk logs the tickets solved in each of n hours. A stretch of k hours is good when its total is at least t. Count the good stretches.
Example
Input
6 2 8 5 3 8 2 7 4
Output
5
The stretch totals are 8, 11, 10, 9 and 11. All five reach 8, so the count is 5.
Try the problem first. Open one hint at a time.
Compare the total with t for the first stretch, then after every move.
A true comparison can be added to a counter because True is 1.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor