Rain Water harvesting

Please tell me what should I do as I am not passing 2-3 testcases

hello @G_rahil
your algorithm time complexity is O(N^2) which is why not all cases are passin.
pls refer this article for detail and all approaches of this solution