Last active
July 18, 2016 04:23
-
-
Save lethain/c1f48522a1a5d69c16bfc7c33a306f63 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Main (main) where | |
minOrZero lst = if null lst then 0 else minimum lst | |
coins 0 _ = 0 | |
coins v ds = (1 + minOrZero [coins (v - d) ds | d <- ds, (v - d) >= 0]) | |
main = do print "start" | |
print (coins 57 [1, 5, 10, 25]) | |
print (coins 15 [1, 6, 9, 10]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment