Rainwater trapping (arrays 1.0)

KINDLY CHECK MY APPROACH. IT’S NOT RUNNING PROPERLY. CAN I KNOW WHAT AM I DOING WRONG?

I would first recommend you to go through the online video lecture on :


and then apply your logic accordingly.
Also one thing I am noticing in the previous doubts of yours is that, you are always using these kinds of statements in your code as, "Enter … "
Pls make sure that you are your input and output should be in same format as stated in the question, so even if your code is correct but the format is different, then also you wont be able to submit your code successfully…

Since, you arent replying anything, I am marking this doubt as resolved, You can reopen it , if u face any issues …