Accenture Interview Question

Rain water trapping dsa problem