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):