Your question is Detect Duplicates in Player List. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
FanDuel contest data may contain the same player more than once because of duplicated feed records or invalid lineup construction. Given a list of player records, return every duplicated player_id exactly once, ordered by the position where that ID is first detected as a duplicate.
Implement find_duplicate_players(players), where players is a list of dictionaries. Each dictionary contains a hashable player_id, represented as an integer or string. Return a list of player IDs that occur at least twice. Each duplicate ID must appear once in the output.
A player ID is added to the result when its second occurrence is encountered. Do not mutate players.
def find_duplicate_players(players):