File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88"""
99
1010
11- def solution (n ) :
11+ def solution (n : int = 20 ) -> int :
1212 """Returns the smallest positive number that is evenly divisible(divisible
1313 with no remainder) by all of the numbers from 1 to n.
1414
Original file line number Diff line number Diff line change 99""" Euclidean GCD Algorithm """
1010
1111
12- def gcd (x , y ) :
12+ def gcd (x : int , y : int ) -> int :
1313 return x if y == 0 else gcd (y , x % y )
1414
1515
1616""" Using the property lcm*gcd of two numbers = product of them """
1717
1818
19- def lcm (x , y ) :
19+ def lcm (x : int , y : int ) -> int :
2020 return (x * y ) // gcd (x , y )
2121
2222
23- def solution (n ) :
23+ def solution (n : int = 20 ) -> int :
2424 """Returns the smallest positive number that is evenly divisible(divisible
2525 with no remainder) by all of the numbers from 1 to n.
2626
You can’t perform that action at this time.
0 commit comments