Closed ceautery closed 6 years ago
You're doing a lot of unnecessary processing for finding the gcd. Consider using something like the following instead:
function gcd(a, b) { return b ? gcd(b, a % b) : a }
I think this also obviates the need for calculating the prime factors.
Looks like something similar was implemented a couple weeks after I opened this. Closing!
You're doing a lot of unnecessary processing for finding the gcd. Consider using something like the following instead:
I think this also obviates the need for calculating the prime factors.