You are viewing a single comment's thread. Return to all comments →
Ruby implementation:
def getTotalX(a, b) lcm, gcd = a.reduce(:lcm), b.reduce(:gcd) return lcm.step(gcd, lcm).select{|i| gcd % i === 0}.to_a.length end
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
Ruby implementation: