Compare commits
2 Commits
39b258ffec
...
6d8e66cc05
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d8e66cc05 | |||
| 72f33ca843 |
16
solution8.py
Normal file
16
solution8.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
def gcd(a: int, b: int) -> int:
|
||||||
|
result = []
|
||||||
|
for i in range(1, min(a, b) + 1):
|
||||||
|
if a % i == 0 and b % i == 0:
|
||||||
|
result.append(i)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
return max(result)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print(gcd(18, 24))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user