Altimetrik Interview Question

Trapping Rain water leet code question,