HashedIn by Deloitte interview question

Rainwater storing approach.coding question Equilibrium point in array