Celigo interview question

Trapping rain water (leetcode 42). it is standard problem.