i have writeen the code but it is not paasing all testcase.
link for my code : https://ide.codingblocks.com/s/200402
Wrong answer histogram
Hello @Debugger,
There is a logical error in your code:
Refer to the comments for better understanding.
Hope, this would help.
Give a like if you are satisfied.
what is logical error please let me know
Hello @Debugger,
-
whenever a smaller element occurs than the stop top and the sack is not empty.
You have to keep popping the elements from it until this condition satisfies. -
every element should be pushed at least once in the stack.
Hope, it is clear now.
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.