6 kyu
Rank Vector
757 of 2,163rtoal
Description:
Given an array (or list) of scores, return the array of ranks for each value in the array. The largest value has rank 1, the second largest value has rank 2, and so on. Ties should be handled by assigning the same rank to all tied values. For example:
array = [9,3,6,10] --> ranks = [2,4,3,1]
array = [3,3,3,3,3,5,1] --> ranks = [2,2,2,2,2,1,7]
because there is one 1st place value, a five-way tie for 2nd place, and one in 7th place.
Arrays
Sorting
Algorithms
Similar Kata:
Stats:
Created | Nov 9, 2014 |
Published | Nov 9, 2014 |
Warriors Trained | 3953 |
Total Skips | 281 |
Total Code Submissions | 11643 |
Total Times Completed | 2163 |
JavaScript Completions | 757 |
Python Completions | 1042 |
Haskell Completions | 142 |
Ruby Completions | 161 |
Rust Completions | 43 |
C# Completions | 81 |
Julia Completions | 13 |
Lua Completions | 27 |
C Completions | 18 |
Total Stars | 81 |
% of votes with a positive feedback rating | 93% of 349 |
Total "Very Satisfied" Votes | 307 |
Total "Somewhat Satisfied" Votes | 35 |
Total "Not Satisfied" Votes | 7 |