scores. They look at runs of exactly width consecutive practices and call a run strong if its average score is at least bar.
Return the number of strong runs. Runs that start at different positions count separately, even if they overlap.scores=[3, 7, 4, 1, 8, 6], width=2, bar=5 → 3
The consecutive pairs are [3, 7] (average 5), [7, 4] (5.5), [4, 1] (2.5), [1, 8] (4.5) and [8, 6] (7). Three of them reach 5.
scores=[2, 2, 2, 2], width=4, bar=3 → 0
The only window is the whole array, and its average 2 is below 3.
scores=[10, 1, 10, 1, 10], width=3, bar=7 → 2
scores) ≤ 10⁵scores[i] ≤ 10⁴width ≤ len(scores)bar ≤ 10⁴scores=[3, 7, 4, 1, 8, 6], width=2, bar=5
3
Run checks the first 3 tests in your browser. Submit checks all 103 tests on the server, hidden ones included.