(defn clos [amount] ; denoms is a list containing the currency denominations (let [denoms '(20)] (reduce (fn [[amount-left coins] denom] (let [{:keys [mod dividend]} (calc-coins amount-left denom)] (if (pos? dividend) [mod (assoc coins denom dividend)] [amount-left coins]))) [amount {}] denoms)))