/**
 * This exercise requires counting the number of customers who have made a purchase.
 * The customersList parameter should be a list of dictionaries, where each dictionary represents a customer.
 * Each customer dictionary should have a 'purchased' key with a boolean value indicating whether they made a purchase or not.
 * Your task is to loop through the list and count the number of customers who have made a purchase.
 * Finally, return the count of customers who made a purchase.
 */
fun countCustomers(customersList: List<Map<String, Any>>): Int {

    // Initialize a variable to keep track of the count
    var purchaseCount = 0

    // Loop through the customersList
    for (customer in customersList) {
        // Check if the 'purchased' key exists and its value is true
        if (customer.containsKey("purchased") && customer["purchased"] == true) {
            // Increment the purchase count
            purchaseCount++
        }
    }

    // Return the count of customers who made a purchase
    return purchaseCount
}
/**
 * This exercise requires counting the number of customers who have made a purchase.
 * The customersList parameter should be a list of dictionaries, where each dictionary represents a customer.
 * Each customer dictionary should have a 'purchased' key with a boolean value indicating whether they made a purchase or not.
 * Your task is to loop through the list and count the number of customers who have made a purchase.
 * Finally, return the count of customers who made a purchase.
 */
fun countCustomers(customersList: List<Map<String, Any>>): Int {
/**
 * This exercise requires counting the number of customers who have made a purchase.
 * The customersList parameter should be a list of dictionaries, where each dictionary represents a customer.
 * Each customer dictionary should have a 'purchased' key with a boolean value indicating whether they made a purchase or not.
 * Your task is to loop through the list and count the number of customers who have made a purchase.
 * Finally, return the count of customers who made a purchase.
 */
fun countCustomers(customersList: List<Map<String, Any>>): Int {

    // Initialize a variable to keep track of the count
    var purchaseCount = 0

    // Loop through the customersList
    for (customer in customersList) {
        // Check if the 'purchased' key exists and its value is true
        if (customer.containsKey("purchased") && customer["purchased"] == true) {
            // Increment the purchase count
            purchaseCount++
        }
    }

    // Return the count of customers who made a purchase
    return purchaseCount
}