Problem 901 · Medium

Online Stock Span

Prices arrive one at a time, and each new quote asks how many consecutive quotes ending today are no higher than it. The visual shows a stack of earlier quotes shrinking as the span boundary moves.

Open the interactive visualisation