We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
x=a[len(a)-1]
y=b[0]
count=0
for p in range(x,y+1):
chk=0
for i in b:
if i%p!=0:
chk=1
break
if chk == 1:
continue
else:
chk1=0
for i in a:
if p%i!=0:
chk1=1
break
if chk1==0:
count+=1
return count
Cookie support is required to access HackerRank
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 →
Its a little optimized version of your code
def getTotalX(a, b):