Minimum water containers

what if i have asked to find the minimum water here.
i am able to use same technique here .?

if i got two same height
i am changing the right part in else part
what if i am given smaller value after that in left part.?
do same approach will work fine .?

Hi… i didn’t get what exactly is ur doubt… can u pls share ur code

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.