1
0
Fork 0

Problem 62

This commit is contained in:
Jonathan Chan 2017-05-28 20:48:33 -07:00
parent 768237c43e
commit f561cc33c3
4 changed files with 27 additions and 0 deletions

BIN
62 Executable file

Binary file not shown.

BIN
62.hi Normal file

Binary file not shown.

27
62.hs Normal file
View File

@ -0,0 +1,27 @@
import Data.List
cubes = [n * n * n | n <- [4142..9999]]
arePermutations :: Integer -> Integer -> Bool
arePermutations a b = null (aStr \\ bStr) && null (bStr \\ aStr)
where aStr = show a
bStr = show b
permutes = [(a, b, c, d, e) | a <- cubes,
b <- cubes,
a < b,
arePermutations a b,
c <- cubes,
b < c,
arePermutations b c,
d <- cubes,
c < d,
arePermutations c d,
e <- cubes,
d < e,
arePermutations d e]
main = print $ head permutes

BIN
62.o Normal file

Binary file not shown.