Design a class that reads a stock's daily prices one at a time and reports each day's span. The span of today's price is the largest number of consecutive days, ending today and counting backward, on which the price was less than or equal to today's price. Implement `StockSpanner()`, which creates the object, and `int next(int price)`, which takes today's price and returns its span.
Design a class that reads a stock's daily prices one at a time and reports each day's span. The span of today's price is the largest number of consecutive days, ending today and counting backward, on which the price was less than or equal to today's price. Implement StockSpanner(), which creates the object, and int next(int price), which takes today's price and returns its span.