You are viewing a single comment's thread. Return to all comments →
def gcd(a,b):
if b==0 :
return a
def ppcm(a,b): return a*b//gcd(a,b)
def solve(a): # Write your code here L=[a[0]] for i in range(len(a)-1): L.append(ppcm(a[i],a[i+1])) L.append(a[-1]) return L
Seems like cookies are disabled on this browser, please enable them to open this website
John and GCD list
You are viewing a single comment's thread. Return to all comments →
def gcd(a,b):
if b==0 :
def ppcm(a,b): return a*b//gcd(a,b)
def solve(a): # Write your code here L=[a[0]] for i in range(len(a)-1): L.append(ppcm(a[i],a[i+1])) L.append(a[-1]) return L