Amdocs Interview Question

Trapping water DSA question in any language