• + 0 comments
    def climbingLeaderboard(ranked, player):
        ranked = sorted(set(ranked), reverse=True)
        negated_list = [-x for x in ranked]
    
        
        
        result = []
        for p in player:
            # Binary search to find the correct rank
            try:
                result.append(ranked.index(p)+1)
            except:
                result.append(bisect.bisect_left(negated_list,-p)+1)
        return result