diff --git a/project_euler/problem_05/sol1.py b/project_euler/problem_05/sol1.py index f8d83fc12b71..a347d6564fa7 100644 --- a/project_euler/problem_05/sol1.py +++ b/project_euler/problem_05/sol1.py @@ -8,7 +8,7 @@ """ -def solution(n): +def solution(n: int = 20) -> int: """Returns the smallest positive number that is evenly divisible(divisible with no remainder) by all of the numbers from 1 to n. diff --git a/project_euler/problem_05/sol2.py b/project_euler/problem_05/sol2.py index 5aa84d21c8e8..57b4cc823d82 100644 --- a/project_euler/problem_05/sol2.py +++ b/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) """ Using the property lcm*gcd of two numbers = product of them """ -def lcm(x, y): +def lcm(x: int, y: int) -> int: return (x * y) // gcd(x, y) -def solution(n): +def solution(n: int = 20) -> int: """Returns the smallest positive number that is evenly divisible(divisible with no remainder) by all of the numbers from 1 to n.