Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Online Stock Span
Bookmark
Input
Input 1
Input 2
Input 3
Custom
prices
=
[100, 80, 60, 70, 60, 75, 85]
prices
100
80
60
70
60
75
85
span
stack ⟨price, span⟩
(empty)
span = consecutive days up to today with price ≤ today's
algo
master
.
io
Step:
Start: online stock span with a monotonic stack
0 / 26
Input
Input 1
Input 2
Input 3
Custom
prices
=
[100, 80, 60, 70, 60, 75, 85]
0 / 26
prices
100
80
60
70
60
75
85
span
stack ⟨price, span⟩
(empty)
span = consecutive days up to today with price ≤ today's
algo
master
.
io
Step:
Start: online stock span with a monotonic stack