Created
October 7, 2015 13:36
-
-
Save vlas-ilya/a79efd9ff8cca3c3f35c to your computer and use it in GitHub Desktop.
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
change n | n < minimum coins = [[]] | |
| otherwise = [xs | x <- coins, | |
x <= n, | |
xs <- map (\ys -> x:ys) $ change (n - x), | |
sum xs == n] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment