You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique.

The athletes are placed based on their scores, where the 1st place athlete has the highest score, the 2nd place athlete has the 2nd highest score, and so on. The placement of each athlete determines their rank:


	The 1st place athlete's rank is "Gold Medal".
	The 2nd place athlete's rank is "Silver Medal".
	The 3rd place athlete's rank is "Bronze Medal".
	For the 4th place to the nth place athlete, their rank is their placement number (i.e., the xth place athlete's rank is "x").


Return an array answer of size n where answer[i] is the rank of the ith athlete.

&nbsp;
Example 1:

Input: score = [5,4,3,2,1]
Output: ["Gold Medal","Silver Medal","Bronze Medal","4","5"]
Explanation: The placements are [1st, 2nd, 3rd, 4th, 5th].

Example 2:

Input: score = [10,3,8,9,4]
Output: ["Gold Medal","5","Bronze Medal","Silver Medal","4"]
Explanation: The placements are [1st, 5th, 3rd, 2nd, 4th].



&nbsp;
Constraints:


	n == score.length
	1 &lt;= n &lt;= 104
	0 &lt;= score[i] &lt;= 106
	All the values in score are unique.


class Solution:
    def findRelativeRanks(self, score: List[int]) -> List[str]:
        scores_ids = []
        for i in range(len(score)):
            scores_ids.append((score[i], i))
        scores_ids.sort(reverse=True)

        ans = [0] * len(scores_ids)
        for i in range(len(scores_ids)):
            ans[scores_ids[i][1]] = str(i+1)

        try:
            ans[scores_ids[0][1]] = "Gold Medal"
            ans[scores_ids[1][1]] = "Silver Medal"
            ans[scores_ids[2][1]] = "Bronze Medal"
        except:
            pass

        return ans
class Solution {
    public String[] findRelativeRanks(int[] score) {
        String[] res = new String[score.length];
        TreeMap<Integer, Integer> map = new TreeMap<>();
        for(int i = 0; i < score.length; i++)   map.put(score[i], i);
        int rank = score.length;
        for(Map.Entry<Integer, Integer> p: map.entrySet()){
            if(rank == 1)   res[p.getValue()] = "Gold Medal";
            else if(rank == 2)   res[p.getValue()] = "Silver Medal";
            else if(rank == 3)   res[p.getValue()] = "Bronze Medal";
            else    res[p.getValue()] = String.valueOf(rank);
            rank--;
        }
        return res;
    }
}
class Solution {
public:
    vector<string> findRelativeRanks(vector<int>& score) {
        int n=score.size();
        vector<string> vs(n);
        unordered_map<int,int> mp;
        for(int i=0; i<score.size(); i++){
            mp[score[i]]=i;
        }
        sort(score.begin(),score.end(),greater<int>());
        for(int i=0; i<score.size(); i++){
            int temp=mp[score[i]];
            if(i==0){
                vs[temp]="Gold Medal";
                continue;
            }
            if(i==1){
                vs[temp]="Silver Medal";
                continue;
            }
            if(i==2){
                 vs[temp]="Bronze Medal";
                 continue;
            }
            int t=i+1;
            string st= to_string(t);
            vs[temp]=st;
        }
        return vs;
    }
};
var findRelativeRanks = function(score) {
    let output=score.slice(0);
    let map={};
    score.sort((a,b)=>b-a).forEach((v,i)=>map[v]=i+1);
    for(let item in map){
        if(map[item]==1){map[item]="Gold Medal"};
        if(map[item]==2){map[item]="Silver Medal"};
        if(map[item]==3){map[item]="Bronze Medal"};
    }
    return output.map(v=>map[v]+""); // +"": num=>str.
};
Relative Ranks