Goldman Sachs Interview Question

Write a code to solve Rain water trapping problem.