Created
August 6, 2012 00:56
-
-
Save 2GMon/3268684 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
-- Project Euler : Problem 15 | |
combination :: Integer -> Integer -> Integer | |
combination n m = product [n,n-1..(n - m + 1)] `div` product [1..m] | |
numRoutes :: Integer -> Integer -> Integer | |
numRoutes x y = combination (x + y) $ min x y | |
main = print $ numRoutes 20 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment