Implement a function to deduplicate loan records based on a composite key while preserving the most recent update timestamp.
The input is a list of dictionaries containing loan_id, investor_id, and an ISO 8601 UTC updated_at string. Use (loan_id, investor_id) as the composite key and return one complete record per key, preserving the order in which unique keys first appear.
def deduplicate_loans(records):
def deduplicate_loans(records):