Histogram problem

I am getting a wrong answer in some test cases .Please help

hello @rahul.gupta03111999

image
interchnage the position of these two conditions.

ur approach is correct, but implementation is very messy .
refer this clean implementation->

It is still giving a wrong answer

@rahul.gupta03111999
r u still facing any issue with this problem?

Yeah the code didn’t wrong. I had sent you the code for correction but I didn’t get a reply.
So yeah, it’s still not resolved.

@rahul.gupta03111999
check 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.