Implement the StockSpanner class, which reads a stock's price one day at a time and reports each day's span. The span on a given day is the number of consecutive days (ending today, going backwards) for which the price was less than or equal to today's price.
StockSpanner() starts with no prices.next(price) records today's price and returns today's span.Each example lists the calls in order, then each call's arguments, then each call's result (null for the constructor).
On the day the price is 75, the four days 60, 70, 60, 75 are all at most 75, and the 80 before them stops the count, so the span is 4.
1 ≤ price ≤ 10⁵10⁴ calls are made to next.Stack of (price, span) pairs; while the top has price ≤ today, accumulate its span and pop.
[null,1,1,1,2,1,4,6]