Stock Span Problem

Given segmentation fault.

@Kinjal
it is because you need to take care if stack is empty or not after popping out some elements in the else case.
Also in else case if somehow stack becomes empty then asn[day] = day+1 else same as you have written.
It will be accepted after doing these updtes. Feel free to ask.

right :+1:

Modified Code

I got it. Thanks for the help.

if your doubt is resolved you should mark is as resolved from doubts in you course and give feedback to help us to improve

okay. I did that. Thanks bhaiya.