Report duplicate identifiers

An order log contains the identifiers in Listing 1. Each identifier should describe one order, so repeated identifiers need review. Retain the original list and its observations.

Listing 1: Six order-log observations, including identifiers that occur repeatedly.
order_ids = ['A01', 'A02', 'A02', 'A03', 'A01', 'A02']

Write a Python function find_duplicate_ids(order_ids) that uses sets to check identifiers and returns a list of repeated identifiers. Include each repeated identifier once, in the order in which its second occurrence is encountered. For the supplied input, return ['A02', 'A01'].

Assume every identifier is a nonempty string. Compare the strings exactly. The function must leave the input list unchanged and return an empty list when no identifier repeats. Check your function with cases that cover empty input, no repeats, and one identifier appearing more than twice.