We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff9be86 commit 6a5a022Copy full SHA for 6a5a022
project_euler/problem_05/sol1.py
@@ -8,7 +8,7 @@
8
"""
9
10
11
-def solution(n):
+def solution(n: int = 20) -> int:
12
"""Returns the smallest positive number that is evenly divisible(divisible
13
with no remainder) by all of the numbers from 1 to n.
14
project_euler/problem_05/sol2.py
@@ -9,18 +9,18 @@
""" Euclidean GCD Algorithm """
-def gcd(x, y):
+def gcd(x: int, y: int) -> int:
return x if y == 0 else gcd(y, x % y)
15
16
""" Using the property lcm*gcd of two numbers = product of them """
17
18
19
-def lcm(x, y):
+def lcm(x: int, y: int) -> int:
20
return (x * y) // gcd(x, y)
21
22
23
24
25
26
0 commit comments