Amazon Interview Question

trapping rainwater problem (available on leetcode and gfg )