Climbers Rankings
Description:
International Federation of Sports Climbing (ISFC) hired You to create "Rank Calculator". Climbers get points for each competition they attend, if they are in the top 30 (1st gets 100, 2nd: 80, 3rd: 65, 4th: 55, 5th: 51,...).
Overall rankings are calculated by summing the best 6 results for each climber respectively. If climber has less than 6 results, existing ones are taken.
#Task: Create GetRankings function, that will take collection of climbers' names with their results, and return collection of climbers' names and sum of their best 6 results. Returned collection should be ordered by sum of results in descending order. With other words: climber with highest sum of points should be first, climber with lowest sum of points should be last.
#Example:
Input: [{"John Anonymous", [100, 80, 40]}, {"Mike TheSecond", [20, 22, 24, 26, 28, 30, 100, 100, 100]}]
Output: [{"Mike TheSecond", 384}, {"John Anonymous", 220}]
Notes
- Not every climber attended all competitions (there can be less than 6 results for climber).
- Only best 6 results are summed at maximum.
Similar Kata:
Stats:
Created | Aug 28, 2016 |
Published | Aug 28, 2016 |
Warriors Trained | 621 |
Total Skips | 37 |
Total Code Submissions | 1250 |
Total Times Completed | 285 |
C# Completions | 133 |
JavaScript Completions | 159 |
Total Stars | 12 |
% of votes with a positive feedback rating | 85% of 96 |
Total "Very Satisfied" Votes | 76 |
Total "Somewhat Satisfied" Votes | 12 |
Total "Not Satisfied" Votes | 8 |
Total Rank Assessments | 13 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |