Created
July 10, 2011 16:18
-
-
Save gfredericks/1074657 to your computer and use it in GitHub Desktop.
mdeboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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