• + 0 comments
    def climbingLeaderboard(ranked, player):
        org_rank = sorted(set(ranked), reverse=True) 
        ans = []
        rank_i = len(org_rank) - 1 
        for score in player:
            while rank_i >= 0 and score >= org_rank[rank_i]:
                rank_i -= 1
            ans.append(rank_i + 2)  
        return ans