• + 3 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?

            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