Stock span problem

i didnt understand he meaning of span what it is and how are we calculating it?

hello @jatinupadhyay786
The span Si of the stock’s price on a given day i is defined as the maximum number of consecutive days just before the given day, for which the price of the stock on the current day is less than or equal to its price on the given day.
image

my code is correct but its giving wrong output here is my code https://ide.codingblocks.com/s/291227

image
put this inside ur for loop.

https://ide.codingblocks.com/s/291832 still not giving correct output?

put s.push(i) inside loop.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.