public static List climbingLeaderboard(List ranked, List player) { List result = new List(); var uniqueRanked = ranked.Distinct().ToList(); int index = uniqueRanked.Count; foreach (int score in player) { // Find the correct rank for the player's score while (index > 0 && score >= uniqueRanked[index - 1]) { index--; } // Add the rank to the result result.Add(index + 1); } return result; }