You are viewing a single comment's thread. Return to all comments →
explation for 3rd line
"Count the number of multiples of LCM that evenly divides the GCD."
Suppose L is your calculated LCM of array A and G is your calulate GCD of array B. Then the result will be number of multiples of L which will evenly devides G. Here evenly devides meaning the remainder will be zero if you devide x by y.
count = 0;
for i = 1 to L*i<=G
if(G%(L*i) == 0)
count = count+1;
@t_tahasin thanks for the response, I underestand what you want to convey in that 3rd line, I was just curious to know why it is so, any mathematical proof or reason to support that line (I was not able to find how you reach to that)