Can i get the code of this problem

can i get the code of this problem?

@anubhavb11
feel free to ask if you have any doubts.

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.


here is my code i tried to code on my own but showing wrong outupt even for sample test case can you please look at it and tell me my mistake

according to your code, you had to use while loop

why you have commented out the last while loop???
what will happen to the elements left in the stack how will they pop out

Because I already did a[n] = 0.

1 Like

but why there will be no elements left in stack to calculate area i am not able to get the logic

okok i got it thank you so much

1 Like