ran npm run tdd
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
module.exports = gcd = (...arr) => {
|
||||
const gcd = (...arr) => {
|
||||
const _gcd = (x, y) => (!y ? x : gcd(y, x % y));
|
||||
return [...arr].reduce((a, b) => _gcd(a, b));
|
||||
};
|
||||
};
|
||||
module.exports = gcd
|
||||
Reference in New Issue
Block a user