-
Notifications
You must be signed in to change notification settings - Fork 0
/
kata.js
24 lines (22 loc) · 1019 Bytes
/
kata.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function expressionMatter(a, b, c) {
return new Array(a * (b + c), a * b * c, a + b * c, (a + b) * c, a + b + c).sort((a, b) => b - a)[0]
}
console.log(expressionMatter(2, 1, 2)); // 6
console.log(expressionMatter(2, 1, 1)); // 4
console.log(expressionMatter(1, 1, 1)); // 3
console.log(expressionMatter(1, 2, 3)); // 9
console.log(expressionMatter(1, 3, 1)); // 5
console.log(expressionMatter(2, 2, 2)); // 8
console.log(expressionMatter(5, 1, 3)); // 20
console.log(expressionMatter(3, 5, 7)); // 105
console.log(expressionMatter(5, 6, 1)); // 35
console.log(expressionMatter(1, 6, 1)); // 8
console.log(expressionMatter(2, 6, 1)); // 14
console.log(expressionMatter(6, 7, 1)); // 48
console.log(expressionMatter(2, 10, 3)); // 60
console.log(expressionMatter(1, 8, 3)); // 27
console.log(expressionMatter(9, 7, 2)); // 126
console.log(expressionMatter(1, 1, 10)); // 20
console.log(expressionMatter(9, 1, 1)); // 18
console.log(expressionMatter(10, 5, 6)); // 300
console.log(expressionMatter(1, 10, 1)); // 12