mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-09 11:09:07 +01:00
12 lines
232 B
JavaScript
12 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;
|
|
}
|