You are viewing a single comment's thread. Return to all comments →
IMO this is to much work/optimization for an easy problem - neither the most trivial (bruteforce the common divisors) nor the first order optimization (only bruteforce the divisors of the GCD) will run in time
I don't know about the other languages, but it's very easy in Racket, as you can just compose 3 existing functions which do all the work.
yes if you know what you are doing - but functional programming is not basic number theory (not all programmers have a math background)
Indeed, at least partly. I don't really have a math background, either. Therefore a good library provided by the language can make the task easier in case you care to look and happen to be able to connect the strings (figuratively).