Skip to content

Commit fd37108

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ba1cbc6 commit fd37108

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

maths/gcd_of_n_numbers.py

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def get_greatest_common_divisor(*numbers: int) -> int:
105105
mult *= m
106106
return mult
107107

108+
108109
def gcd_tail_recursive(a: int, b: int) -> int:
109110
"""
110111
Calculate the Greatest Common Divisor (GCD) using a tail-recursive approach.
@@ -150,6 +151,7 @@ def gcd_tail_recursive(a: int, b: int) -> int:
150151
return abs(a)
151152
return gcd_tail_recursive(b, a % b)
152153

154+
153155
if __name__ == "__main__":
154156
print(get_greatest_common_divisor(18, 45)) # 9
155157
print(gcd_tail_recursive(23, 37)) # 1

0 commit comments

Comments
 (0)