(defn trapped-water [towers]
  (let [maxes #(reductions max %)                
        maxl  (maxes towers)                     
        maxr  (reverse (maxes (reverse towers))) 
        mins  (map min maxl maxr)]               
    (reduce + (map - mins towers))))