We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f77b945 commit 7a90a36Copy full SHA for 7a90a36
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