/**
 * Given a map of customers and their ages, filter out the customers whose age exceeds the target age.
 * Each customer is represented by a Pair containing their name and age.
 *
 * @param customers A map of customers where the keys are their names and the values are their ages.
 * @param targetAge An integer representing the maximum age a customer can have.
 * @return A list of Pairs representing the filtered customers.
 *
 * Example:
 * val customers = mapOf(
 *     "John" to 32,
 *     "Amy" to 25,
 *     "Mark" to 40,
 *     "Jessica" to 28,
 *     "Emily" to 35
 * )
 *
 * filterCustomers(customers, 30) should return listOf(Pair("Amy", 25), Pair("Jessica", 28))
 */
fun filterCustomers(customers: Map<String, Int>, targetAge: Int): List<Pair<String, Int>> {

    val filteredCustomers = mutableListOf<Pair<String, Int>>()
    for ((name, age) in customers) {
        if (age <= targetAge) {
            filteredCustomers.add(Pair(name, age))
        }
    }
    return filteredCustomers
}
/**
 * Given a map of customers and their ages, filter out the customers whose age exceeds the target age.
 * Each customer is represented by a Pair containing their name and age.
 *
 * @param customers A map of customers where the keys are their names and the values are their ages.
 * @param targetAge An integer representing the maximum age a customer can have.
 * @return A list of Pairs representing the filtered customers.
 *
 * Example:
 * val customers = mapOf(
 *     "John" to 32,
 *     "Amy" to 25,
 *     "Mark" to 40,
 *     "Jessica" to 28,
 *     "Emily" to 35
 * )
 *
 * filterCustomers(customers, 30) should return listOf(Pair("Amy", 25), Pair("Jessica", 28))
 */
fun filterCustomers(customers: Map<String, Int>, targetAge: Int): List<Pair<String, Int>> {
/**
 * Given a map of customers and their ages, filter out the customers whose age exceeds the target age.
 * Each customer is represented by a Pair containing their name and age.
 *
 * @param customers A map of customers where the keys are their names and the values are their ages.
 * @param targetAge An integer representing the maximum age a customer can have.
 * @return A list of Pairs representing the filtered customers.
 *
 * Example:
 * val customers = mapOf(
 *     "John" to 32,
 *     "Amy" to 25,
 *     "Mark" to 40,
 *     "Jessica" to 28,
 *     "Emily" to 35
 * )
 *
 * filterCustomers(customers, 30) should return listOf(Pair("Amy", 25), Pair("Jessica", 28))
 */
fun filterCustomers(customers: Map<String, Int>, targetAge: Int): List<Pair<String, Int>> {

    val filteredCustomers = mutableListOf<Pair<String, Int>>()
    for ((name, age) in customers) {
        if (age <= targetAge) {
            filteredCustomers.add(Pair(name, age))
        }
    }
    return filteredCustomers
}