class Solution {
public:
vector<string> findRelativeRanks(vector<int>& nums) {
vector<int>order;
vector<string>ans(nums.size());
for(int i = 0;i<nums.size();i++) order.push_back(i);
sort(order.begin(),order.end(),[&nums](const int&a,const int&b){return nums[a]>nums[b];});
for(int i = 0;i<order.size();i++)
{
switch(i)
{
case 0:
ans[order[i]] = "Gold Medal";
break;
case 1:
ans[order[i]] = "Silver Medal";
break;
case 2:
ans[order[i]] = "Bronze Medal";
break;
default:
ans[order[i]] = to_string(i+1);
break;
}
}
return ans;
}
};