feat: add gcd at the end of the file

This commit is contained in:
typosaurus 2026-07-25 18:51:44 +02:00
parent cb4c5516ad
commit ff830c6fb8

View File

@ -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)