Haskell version is naive too.<p>My laptop runs the original in about 3.07s and my improvements bring it down to 1.20s though I think there&#x27;s room for improvement.<p>[EDIT] My improvements were actually not the same algorithm as the original&#x27;s, with algorithm corrections my version is actually slower!