# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

class Solution:
    def findRelativeRanks(self, nums: [int]) -> [str]:
        score = list(set(nums))
        score.sort(reverse=True)
        
        rank_dict = {}
        for i in range(len(score)):
            if i == 0:
                rank_dict[score[i]] = "Gold Medal"
            elif i == 1:
                rank_dict[score[i]] = "Silver Medal"
            elif i == 2:
                rank_dict[score[i]] = "Bronze Medal"
            else:
                rank_dict[score[i]] = str(i+1)
        
        rank_list = []
        for x in nums:
            rank_list.append(rank_dict[x])
        
        return rank_list


s = Solution()

s.findRelativeRanks([5,4,3,2,1])



StarcoderdataJupyterScriptsDedupFiltered