Goldman Sachs Interview Question

Answer the classic trapping rainwater leetcode question