Stock span problem code is not running

stock span problem code is not giving any output

problem : https://online.codingblocks.com/app/player/39658/content/55442/4921/code-challenge?code=4Ofra3JFKWb8PkInwxkZVKdvMYmt8FBA

code :https://ide.codingblocks.com/s/188898

plz make the changes and let me know my mistake

@sengarankit98
hello ankit,
a) in line no 16 u should start from i=1 because u have alredy filled answer for i=0
b) in line no 18 , it should be while(s.empty()==false &&arr[s.top()]<arr[i] ) i.e first check whether stack is empty or not and then any other condition
c) in line no 22 , if stk.empty() then it should be -1 in place of zero because ( in that case total day+1 span should be there)

check ur correctd code here-> https://ide.codingblocks.com/s/189737

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.