diff --git a/src/algorithm/lcm_normal.py b/src/algorithm/lcm_normal.py index 6c018ed..94b4103 100644 --- a/src/algorithm/lcm_normal.py +++ b/src/algorithm/lcm_normal.py @@ -5,4 +5,18 @@ # CANNOT use library def lcm(a, b): - return 0 + storea = a + storeb = b + if(b > a): + temp = a + a = b + b = temp + + r = a % b + while(r != 0): + a = b + b = r + r = a % b + + + return (storea * storeb) / b