public
Last active

Project Euler - Problem 9

  • Download Gist
euler-009.hs
Haskell
1 2 3 4 5 6 7 8
result = truncate
$ product
$ head
$ filter (\ns -> sum ns == 1000)
$ map (\[x,y,xy'] -> [x,y,sqrt(xy')])
[[x, y, x^2 + y^2] |
x <- [1..995],
y <- [(x + 1)..996]]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.