You are viewing a single comment's thread. Return to all comments →
In this case I think is more readable non recursive solution:
vector<int> A(m); vector<int> B(n); /// [...] auto lcmOfA = lcm_element(A); auto gcdOfB = gcd_element(B); auto counter = 0; auto multipleOfLcm = lcmOfA; while (multipleOfLcm <= gcdOfB) { counter += is_divisible(gcdOfB, multipleOfLcm); multipleOfLcm += lcmOfA; }
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 →
In this case I think is more readable non recursive solution: