6 kyu
Ranking System
542 of 1,099tostaylo
Description:
You are given an array of unique numbers. The numbers represent points. The higher the number the higher the points. In the array [1,3,2] 3 is the highest point value so it gets 1st place. 2 is the second highest so it gets second place. 1 is the 3rd highest so it gets 3rd place.
Your task is to return an array giving each number its rank in the array.
input // [1,3,2]output // [3,1,2]
rankings([1,2,3,4,5]) // [5,4,3,2,1]
rankings([3,4,1,2,5])// [3,2,5,4,1]
rankings([10,20,40,50,30]) // [5, 4, 2, 1, 3]
rankings([1, 10]) // [2, 1]
rankings([22, 33, 18, 9, 110, 4, 1, 88, 6, 50]) //
[5, 4, 6, 7, 1, 9, 10, 2, 8, 3]
Fundamentals
Similar Kata:
Stats:
Created | Apr 2, 2017 |
Published | Apr 3, 2017 |
Warriors Trained | 1700 |
Total Skips | 28 |
Total Code Submissions | 3051 |
Total Times Completed | 1099 |
JavaScript Completions | 580 |
Python Completions | 542 |
Total Stars | 30 |
% of votes with a positive feedback rating | 95% of 296 |
Total "Very Satisfied" Votes | 268 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 12 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |