Sir what’s wrong in my code as it is giving me an error.
Rain Water Harvesting
I am finding number greater than current number on left and on right. Then finding minimum of two no. Then subtracting the current number from minimum of lmax and rmax to get unit of water. And adding these units to get result.
@yash_aryan your logic is partially corret you have to maintain one array for that to maintain the max till that point from the starting and from the ending.
so there will be 2 extra arrays as well.
you can see this code for complete explanation.
Happy Learning!!
Can I get a link to it’s video solution on Coding Blocks?
@yash_aryan yes sure .
here is the link to the video:
https://www.youtube.com/watch?v=Uog2Jmyb3iY
Happy Learning!!
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.