Amazon Interview Question

One was trapping rain water leetcode(medium)