i understand the problem but i cant find the right logic that could be applied to solve it
please help me find the logic through which this question could be solved
also correct my code
Please correct my code and find the right logic to solve problem
Hi Arya
I am unable to understand what approach u are taking.
basically what u can simply do is find the left and right boundaries and then compute the ans… refer this https://ide.codingblocks.com/s/616242
okay got it but can you explain what approach or logic you used to start with the question?
basically at every point we are trying to calculate how much water can be collected… for that we calculate left and right boundaries and compute the ans… try to dry run the code
hi… do u still have any doubts in this ques???
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.