hackerrank between two sets solution in python code example
Example: hackerrank between two sets solution in python
# Complete the 'getTotalX' function below.
def getTotalX(a, b):
maxA = max(a)
minB = min(b)
count = 0
for num in range(maxA, minB + 1):
left = all([num % numA == 0 for numA in a])
right = all([numB % num == 0 for numB in b])
count += left * right
return count