Skip to content

Commit 8d1cce3

Browse files
authored
Merge pull request prabhupant#117 from louietyj/lcm
Add least_common_multiple
2 parents fc1420b + 885837c commit 8d1cce3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"""
2+
Given two input integers, find their Least Common Multiple.
3+
"""
4+
5+
from greatest_common_divisor import gcd
6+
7+
def lcm(x, y):
8+
return abs(x * y) // gcd(x, y)

0 commit comments

Comments
 (0)