Opening your workspace…
Workspace/Coding room
Opening your workspace…
A sensor records an integer temperature for each pour along a brewery tasting line. A steady run is a nonempty contiguous sequence containing between minPours and maxPours pours, inclusive, whose highest and lowest temperatures differ by at most tolerance. Count all steady runs. Distinct starting or ending positions count as different runs, even if their temperatures match. Do not rearrange the pours.
[3,4,6,5], 2, 2, 3OUTPUT4All three length-2 runs qualify. Of the two length-3 runs, only [4, 6, 5] has range at most 2. The total is four.
[8,8,8], 0, 1, 3OUTPUT6Three single pours, two length-2 runs, and one length-3 run all have temperature range zero.
Tab inserts two spaces. Press Escape, then Tab, to leave the editor. Press Control or Command and Enter to submit.
[3,4,6,5], 2, 2, 34Public samples only. These checks do not award ranked points.
Walk through a solution, check its time and space costs, and compare it with yours.
Checking your progress…