← ALL NOTES
Stack

901. Online Stock Span

A stream of daily stock prices; for each new price return its "span" — the number of consecutive days back (including today) with price ≤ today's. The insight is that a new price absorbs the spans of…

Loading…