Opening your workspace…
Workspace/Coding room
Opening your workspace…
A row of connected taps has integer capacities. For each contiguous, nonempty window whose length is between minTaps and maxTaps inclusive, its bottleneck is the smallest capacity in that window. Return the sum of these bottlenecks over all qualifying windows. Windows at different positions count separately, even when their capacities are identical. The result is an ordinary integer: do not apply a modulus.
[4,2,3], 1, 2OUTPUT13Length-1 bottlenecks sum to 4 + 2 + 3 = 9. The two length-2 windows each have bottleneck 2, giving 13.
[5,5,5], 2, 3OUTPUT15There are two length-2 windows and one length-3 window. Each contributes 5, regardless of which equal tap is chosen as its minimum.
Tab inserts two spaces. Press Escape, then Tab, to leave the editor. Press Control or Command and Enter to submit.
[4,2,3], 1, 213Public 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…