sir I am getting 17 instead of 5
please correct my code
Rainwater trapping
@Megha2468
You sent the code for a wrong ques.
This one seems to be maximum circular sum.
Please send code for rain water trapping question.
sorry sir this is the correct code
Hey @Megha2468
Your code is incorrect due to fault in logic and is also inefficient since it is a N^2 algo while the ans for this is N complexity.
Please see this https://www.geeksforgeeks.org/trapping-rain-water/
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.