modular arithmetic course - challenge 1 - gcd
This commit is contained in:
parent
c62223d98c
commit
716ccc14b3
2 changed files with 16 additions and 3 deletions
7
modular_arithmetic.py
Normal file
7
modular_arithmetic.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Challenge 1 - gcd
|
||||
def gcd(a: int, b: int) -> int:
|
||||
while b != 0:
|
||||
r = a % b
|
||||
a = b
|
||||
b = r
|
||||
return a
|
||||
Loading…
Add table
Add a link
Reference in a new issue