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.
hi, your code is really nice and optimized. Can you check my code. It passed all testcases but i want to know is it possible to optimize it?
def getTotalX(a, b):
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
chk1=0
for i in a:
if p%i!=0:
chk1=1
break
if chk==0 and 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 →
hi, your code is really nice and optimized. Can you check my code. It passed all testcases but i want to know is it possible to optimize it?