answer is wrong
https://ide.codingblocks.com/s/107171 (my code)
Hello @suraj20000421,
There are multiple issues with your code:
The input format is wrong.
You are not taking input for T.
How are you so sure that there would not be more than 7 elements in the array:
void stockSpan(int arr[7], int n)
Solution:
void stockSpan(int arr[], int n)
Your output format is also wrong.
0 0 0 1 0 END
You are not required to print END at last.
Solution:
Read the question carefully.
Please review your logic as it will print 0 for the first element always.
Thus, the other values would get effected.
Do you want me to explain the correct logic?
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.