Given a GET API returning JSON for 100 customers, write code to manipulate it and map it to the required response.
Asked in the Coding round stage.
Implement def map_customers(customers):. The input is a list of customer objects with id, firstName, lastName, email, status, and address.city and address.country. Return only customers whose status is active, normalizing names and emails, and map each result to customerId, displayName, email, city, and country. Sort the response by customerId ascending.
Example: an active customer with firstName: " ava " and email " AVA@EXAMPLE.COM " becomes {"customerId": 1, "displayName": "Ava ..."}. Input contains 1 to 100 customers with unique integer IDs.
def map_customers(customers):