You are viewing a single comment's thread. Return to all comments →
Can you explain what happens when there is a single element in A with value 1 and a single element in B with value 100?
See below explanation with your input.
Step-1: LCM of array A will be 1.
Step-2: GCD of array B will be 100.
Step-3: The multiples of LCM(1) that evenly devides GCD(100) are
1,2,4,5,10,20,25,50,100. So the answer will be 9.
Note: evenly divisible means the remainder will be 0 after division. If M evenly devides N then N % M == 0.
Thankyou for explaining in detail.