Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
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
0
100
1
80
2
60
3
70
4
60
5
75
6
85
spans
0
0
0
0
0
0
0
stack (price:span)
algo
master
.
io
Step:
Start: Online Stock Span using a monotonic stack
Variable
Value
prices
Array(7) [100, 80, 60...]
stack
-
spans
-
Variable
Value
i
-
span
-
0 / 26
Input
Input 1
Input 2
Input 3
Custom
prices
=
[100, 80, 60, 70, 60, 75, 85]
0 / 26
prices
0
100
1
80
2
60
3
70
4
60
5
75
6
85
spans
0
0
0
0
0
0
0
stack (price:span)
algo
master
.
io
Step:
Start: Online Stock Span using a monotonic stack
Visualization
Variables