I am trying to teach myself haskell by means of project Euler
i sovled problem #9 by means of this code which is on the brute force side I was wondering if there is a more elegant/haskell/efficient solution
let project_euler_9 = [(a,b,c) | c <- [1..500], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2, a+b+c==1000 ]
(a*b*c)
? \$\endgroup\$a+b+c==1000
anda^2+b^2 == c^2
and how that order might affect run time. Also, froma+b+c == 1000
you can replacea <- [1..b]
witha = 1000-b-c
. \$\endgroup\$