Created
April 5, 2013 02:48
-
-
Save windelicato/5316212 to your computer and use it in GitHub Desktop.
Project Euler #15
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
| factorial :: Integer -> Integer | |
| factorial n = foldr (*) 1 [1..n] | |
| choose :: Integer -> Integer -> Integer | |
| choose n k = (factorial n) `div` ((factorial k) * (factorial (n - k))) | |
| main :: IO () | |
| main = print $ choose 40 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment