7 kyu
Pirate Code
478 of 803Parix
Description:
Take a look at this pirate game.
Give Amaro an array to confirm his logic for the next time, when the number of pirates changes.
Keep in mind that each time the pirates find a treasure, the amount of gold equals to the number of pirates * 20
.
Example:
If number of pirates is 2, including Amaro, then array = [40, 0]
, So he can keep all of the gold to himself.
If number of pirates is 3, including Amaro, then array = [59, 0, 1]
, and 59 gold is his for the taking.
If number of pirates is 4, including Amaro, then array = [79, 0, 1, 0]
, and 79 gold is his to take.
If number of pirates is 5, including Amaro, then array = [98, 0, 1, 0, 1]
, and 98 gold is his for the taking.
...
Puzzles
Games
Fundamentals
Arrays
Similar Kata:
Stats:
Created | Oct 18, 2017 |
Published | Oct 18, 2017 |
Warriors Trained | 1483 |
Total Skips | 11 |
Total Code Submissions | 2032 |
Total Times Completed | 803 |
JavaScript Completions | 478 |
Ruby Completions | 37 |
Python Completions | 320 |
Total Stars | 19 |
% of votes with a positive feedback rating | 89% of 197 |
Total "Very Satisfied" Votes | 163 |
Total "Somewhat Satisfied" Votes | 25 |
Total "Not Satisfied" Votes | 9 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |