Cisco Interview Question

Trapping water leetcode hard problem