Computer scienceFundamentalsInterview preparation

Python Junior Developer

Theory

Optimizing sum of unique elements

Report a typo

Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!

You are working on a function calculate_unique_player_scores that calculates the total score of unique player IDs from a massive multiplayer online game (MMO) with billions of players:

def calculate_unique_player_scores(player_scores):
    # TODO: Return the sum of unique player scores
    pass

Each player's score should only be counted once. Which Python collections and methods would you use to implement this function?

Select one option from the list
___

Create a free account to access the full topic