Histogram stack problem

Don’t know why my code is not able to pass test case plz suggest solution:

you have unnecesarily made the question complex by increasing its time and space complexity .
please see this code :


if you dint understand anything please let me know .
Happy Learning !!

no I want to know where my approach is failing !! bcz I ran many test cases and they were getting passed but on submit showing wrong


please see this .
your code is givng the run error this means accorsing to the test cases .
your code isnot optimized .

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.