How would you write production-ready code that is correct, optimized, and modular?
Implement deduplicate(values) to return the input integers with duplicates removed while preserving the order of their first occurrence. The function must not mutate values and should use an efficient data structure for membership checks.
Input: a list of integers. Output: a new list containing each distinct integer once.
def deduplicate(values):