Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Project Eular 32 by Haskell
import Data.List
make_list :: [Int]
make_list = [x * y | x <- [1..5000],y <- [1..5000], ((sort ((show x) ++ (show y) ++ (show (x * y)))) == "123456789")]
duple_filter :: [Int] -> [Int] -> [Int]
duple_filter x y
| y == [] = x
| otherwise = duple_filter ((head y) : x) (filter (/= (head y)) y)
main = putStrLn $ show $ sum $ duple_filter [0] $ make_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.