Rain water harvesting

what are the constraints given in the question?

There are no such constraints, you can simply make an array of size 100 … There are no other constraints as such in the question.

ok…

pls help it is failing 2 test cases out of 3.
link…

Mudit, I have edited your code now, basically instead of the leftmost and rightmost variables, I have created them as an array and also created a new array value to calculate the answer, Pls refer to this code for the changes and then try to submit, if you didnt understood anything, pls let me know,

Thanks…It works fine for all test cases