mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-09-08 01:26:57 +02: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;
|
|
}
|