Travis build: 483

This commit is contained in:
Travis CI
2017-12-29 11:16:09 +00:00
parent 501fec2535
commit 12d83c89bf
5 changed files with 32 additions and 102 deletions

View File

@ -11,7 +11,7 @@ const gcd = (...arr) => {
let data = [].concat(...arr);
const helperGcd = (x, y) => (!y ? x : gcd(y, x % y));
return data.reduce((a, b) => helperGcd(a, b));
}
};
```
```js

View File

@ -10,11 +10,11 @@ const lcm = (...arr) => {
let data = [].concat(...arr);
const gcd = (x, y) => (!y ? x : gcd(y, x % y));
const helperLcm = (x, y) => x * y / gcd(x, y);
return arr.reduce((a, b) => helperLcm(a, b))
}
return arr.reduce((a, b) => helperLcm(a, b));
};
```
```js
lcm(12, 7); // 84
lcm([1,3,4],5); // 60
lcm([1, 3, 4], 5); // 60
```