Bug Report for https://neetcode.io/problems/online-stock-span
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
span is 3 not 4.
For example, if the prices of the stock in the last four days is [7,2,1,2] and the price of the stock today is 2, then the span of today is 4 because starting from today, the price of the stock was less than or equal 2 for 4 consecutive days.
- For today's 2, we don't look for all previous days whose price is ≤ 2. We start from today and move backward continuously until we encounter a price greater than 2. so here the span is 3 not 4.
Bug Report for https://neetcode.io/problems/online-stock-span
Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
span is 3 not 4.
For example, if the prices of the stock in the last four days is [7,2,1,2] and the price of the stock today is 2, then the span of today is 4 because starting from today, the price of the stock was less than or equal 2 for 4 consecutive days.