mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-09 19:19:07 +01:00
13 lines
232 B
JavaScript
13 lines
232 B
JavaScript
|
function amaroPlan(pirateNum){
|
||
|
let total = 20 * pirateNum;
|
||
|
|
||
|
let result = [];
|
||
|
result.push(total - Math.floor((pirateNum - 1) / 2));
|
||
|
|
||
|
for (let i = 1; i < pirateNum; i++) {
|
||
|
result.push((i + 1) % 2);
|
||
|
}
|
||
|
|
||
|
return result;
|
||
|
}
|