July 25, 2021
def solution(n, m):
gcd = get_gcd(n, m)
return gcd, n * m / gcd
def get_gcd(a, b):
if b > a:
a, b = b, a
while b > 0:
temp = b
b = a % b
a = temp
return a
def gcdlcm(a, b):
c, d = max(a, b), min(a, b)
t = 1
while t > 0:
t = c % d
c, d = d, t
answer = [c, int(a*b/c)]
return answer