Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project_euler/problem_05/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions project_euler/problem_05/sol2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down