Implement a function to deduplicate records from a list of customer events while preserving the most recent event for each customer.
Define deduplicate_events(events), where events is a list of dictionaries containing customer_id, timestamp, and event. Return one dictionary per customer. The record with the greatest timestamp is retained; if timestamps tie, keep the later input record. Return results in the order each customer first appears.
list[dict]list[dict]customer_id, timestamp, and eventcustomer_id is a non-empty stringtimestamp is an integerdef deduplicate_events(events):