leetcode506】的更多相关文章

Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". Example 1: Input: [5, 4, 3, 2, 1] Output: [&…
public class Solution { public string[] FindRelativeRanks(int[] nums) { var list = nums.OrderByDescending(x => x).ToList(); var count = nums.Count(); Dictionary<int, string> dic = new Dictionary<int, string>(); string[] ary = new string[cou…
给出 N 名运动员的成绩,找出他们的相对名次并授予前三名对应的奖牌.前三名运动员将会被分别授予 "金牌","银牌" 和" 铜牌"("Gold Medal", "Silver Medal", "Bronze Medal"). (注:分数越高的选手,排名越靠前.) 示例 1: 输入: [5, 4, 3, 2, 1] 输出: ["Gold Medal", "Sil…