Skip to content

Instantly share code, notes, and snippets.

@gfredericks
Created July 10, 2011 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gfredericks/1074657 to your computer and use it in GitHub Desktop.
Save gfredericks/1074657 to your computer and use it in GitHub Desktop.
mdeboard
(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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment