feat: add gcd at the end of the file
This commit is contained in:
@@ -12,3 +12,9 @@ def modulo(left: int, right: int) -> int:
|
||||
if right == 0:
|
||||
raise ValueError('modulo by zero')
|
||||
return left % right
|
||||
|
||||
|
||||
def gcd(left: int, right: int) -> int:
|
||||
while right:
|
||||
left, right = right, left % right
|
||||
return abs(left)
|
||||
|
||||
Reference in New Issue
Block a user