Stock_span_problem_video

in the line 15 of the code where we have used ternary if else. shouldn’t the condition be betterday=s.empty()?day:s.top(); because if there is no value greater than a day’s stock then then the span should be zero for that day. But according to this condition the span will be the index of that day in the array.

Hi @ParvBudh, pls save ur code on ide.codingblocks.com and share the URL here.

can you please tell why is the error coming?? Link: https://ide.codingblocks.com/s/97557