what should be the answer for the input
37 35 40 38 35
as i have done it like
https://ide.codingblocks.com/s/217153 and am getting 2 test cases wrong and 2 right
what should be the answer for the input
37 35 40 38 35
as i have done it like
https://ide.codingblocks.com/s/217153 and am getting 2 test cases wrong and 2 right
ans for your input 37 35 40 38 35 is
1 1 3 1 1 END
read question again
A span of a stock’s price on a given day, i, is the maximum number of consecutive days before the (i+1)th day, for which stock’s price on these days is less than or equal to that on the ith day.
means stock prices should be increasing till that day and no of such days is span of that day
i have put a if condition that if t>1 then only subtract 1 else just increase j and return to while loop now also 2 test cases are wrong
your code is not giving correct output even on sample input
try again
read the defination of span carefully
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.