the problem statement is not clear
I didn't understand the question please help me
Hey @kundankumarsports2
In this problem you’ve to analyse the amount of water that can be trapped between the bars so that overflow doesn’t occur, lets analyse the example given:
On the first bar you can’t store water coz it’ll overflow on left side
On the second bar you can store water only till height 1 units to prevent overflowing
On third first bar you can’t store water coz it’ll overflow on both sides
On the fourth bar you can store water only till height 2 units to prevent overflowing
Basically, An element of the array can store water if there are higher bars on left and right. We can find the amount of water to be stored in every element by finding the heights of bars on left and right sides.
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.
