bug fix in gcd.md
There is a function-redefined bug in origin code. This PR uses an alias to fix the bug.
This commit is contained in:
@ -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
|
from math import gcd as gcd_from_math
|
||||||
|
|
||||||
def gcd(numbers):
|
def gcd(numbers):
|
||||||
return reduce(gcd, numbers)
|
return reduce(gcd_from_math, numbers)
|
||||||
```
|
```
|
||||||
|
|
||||||
```py
|
```py
|
||||||
|
|||||||
Reference in New Issue
Block a user