Given a set of transaction IDs, how would you detect duplicates efficiently?
Implement find_duplicate_ids(transaction_ids), which accepts a list of strings and returns each duplicated ID once, in the order it is encountered for the second time. Return an empty list when no ID appears more than once.
def find_duplicate_ids(transaction_ids):