Altimetrik interview question

Trapping Rain water leet code question,