Code not working


This was my code. I had scene some of the references but was unable to get the correct output.
Please can you send me your code

Just one update in your code;
int cur_water = min(left[i],right[i]) - arr[i];
if(cur_water>0)
total += cur_water;

still not got the answer

try using long long type for total

still not getting the right answer after using long long. Please send me your code


look at it

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.