Stock span problem

Hey why my code is not showing any output what is wrong i have saved the code at the given link

here’s your code with output, but it is still wrong because your logic isn’t correct. Your should start storing numbers in the stack and when the number is greater than the stack.top() then pop till this condition holds and set the ans for all of these numbers that are popped.

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.