Generation

time complexitySun, 13 Nov 2022

def NWDkilka(x, y): while y: x, y = y, x % y return x l = [24,48,60] num1 = l[0] num2 = l[1] gcd = NWDkilka(num1, num2) for i in range(2, len(l)): gcd = NWDkilka(gcd, l[i]) print(gcd)

O(n)

Questions about programming?Chat with your personal AI assistant