You are viewing a single comment's thread. Return to all comments →
My Python code is unable to complete four testcases because it can't complete the task within the time limit. Can anyone hlep me optimize my code?
def climbingLeaderboard(ranked, player): ranks = [] for a in range(len(player)): ranked.append(player[a]) ranked = list(reversed(sorted(list(set(ranked))))) ranks.append(ranked.index(player[a]) + 1) return ranks
Seems like cookies are disabled on this browser, please enable them to open this website
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
My Python code is unable to complete four testcases because it can't complete the task within the time limit. Can anyone hlep me optimize my code?