5 ms·
You are right about more performant, but how is it cleaner and more readable than this? pyth x = [(a,b,c) | a<-[1..x], b<-[1..x], c<-[1..x], (a^2)+(b^2) == (
by cgh 13y ago
You are right about more performant, but how is it cleaner and more readable than this?
pyth x = [(a,b,c) | a<-[1..x], b<-[1..x], c<-[1..x], (a^2)+(b^2) == (c^2)]
- dkhenry 13y agoThats not c++ code. My claim is that if you try to stay pure using C++ you end up with very very ugly code that preforms pretty poorly.