Update gcd.md
This commit is contained in:
committed by
GitHub
parent
1069939543
commit
0e18e286e3
@ -9,10 +9,10 @@ Use `functools.reduce()` and `math.gcd()` over the given list.
|
|||||||
|
|
||||||
```py
|
```py
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from math import gcd as gcd_from_math
|
from math import gcd as _gcd
|
||||||
|
|
||||||
def gcd(numbers):
|
def gcd(numbers):
|
||||||
return reduce(gcd_from_math, numbers)
|
return reduce(_gcd, numbers)
|
||||||
```
|
```
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|||||||
Reference in New Issue
Block a user