Step 1: Start with day 0, stack empty, push index 0
Stack: [0]
Span: [1, _, _, _, _, _, _]
Why: First day always has span 1 because no previous days
Step 2: Day 1 price 80 less than price at stack top day 0 (100), push index 1
Stack: [0, 1]
Span: [1, 1, _, _, _, _, _]
Why: Price lower, so span is 1, push to stack to check future days
Step 3: Day 2 price 60 less than price at stack top day 1 (80), push index 2
Stack: [0, 1, 2]
Span: [1, 1, 1, _, _, _, _]
Why: Price lower, span 1, push index
Step 4: Day 3 price 70 greater than price at stack top day 2 (60), pop 2; still less than day 1 (80), push 3
Stack: [0, 1, 3]
Span: [1, 1, 1, 2, _, _, _]
Why: Pop days with lower price to find last higher price day; span = current index - stack top index
Step 5: Day 4 price 60 less than price at stack top day 3 (70), push 4
Stack: [0, 1, 3, 4]
Span: [1, 1, 1, 2, 1, _, _]
Why: Lower price, span 1, push index
Step 6: Day 5 price 75 greater than day 4 (60), pop 4; greater than day 3 (70), pop 3; less than day 1 (80), push 5
Stack: [0, 1, 5]
Span: [1, 1, 1, 2, 1, 4, _]
Why: Pop lower prices to find last higher price day; span = 5 - 1 = 4
Step 7: Day 6 price 85 greater than day 5 (75), pop 5; greater than day 1 (80), pop 1; less than day 0 (100), push 6
Stack: [0, 6]
Span: [1, 1, 1, 2, 1, 4, 6]
Why: Pop lower prices to find last higher price day; span = 6 - 0 = 6
Result: Final span array: [1, 1, 1, 2, 1, 4, 6]