/**
 * Returns a list of matching customers based on identity comparison and indexing
 */
fun findMatchingCustomers(customersList: List<Map<String, Any>>, targetCustomer: Map<String, Any>): List<Map<String, Any>> {

    // Initialize an empty list to store the matching customers
    val matchingCustomers = mutableListOf<Map<String, Any>>()

    // Iterate through each customer in the customersList
    for (customer in customersList) {
        // Compare the customer with the targetCustomer using identity comparison
        if (customer === targetCustomer) {
            // Append the matching customer to the list
            matchingCustomers.add(customer)
        }
    }

    // Return the list of matching customers
    return matchingCustomers
}

// Example usage
val customer1 = mapOf("name" to "John", "age" to 30, "email" to "john@example.com")
val customer2 = mapOf("name" to "Jane", "age" to 25, "email" to "jane@example.com")
val customer3 = mapOf("name" to "John", "age" to 30, "email" to "john@example.com")

val customers = listOf(customer1, customer2, customer3)

val targetCustomer = mapOf("name" to "John", "age" to 30, "email" to "john@example.com")

// Find matching customers based on identity comparison and indexing
val matchingCustomers = findMatchingCustomers(customers, targetCustomer)
/**
 * Returns a list of matching customers based on identity comparison and indexing
 */
fun findMatchingCustomers(customersList: List<Map<String, Any>>, targetCustomer: Map<String, Any>): List<Map<String, Any>> {
/**
 * Returns a list of matching customers based on identity comparison and indexing
 */
fun findMatchingCustomers(customersList: List<Map<String, Any>>, targetCustomer: Map<String, Any>): List<Map<String, Any>> {

    // Initialize an empty list to store the matching customers
    val matchingCustomers = mutableListOf<Map<String, Any>>()

    // Iterate through each customer in the customersList
    for (customer in customersList) {
        // Compare the customer with the targetCustomer using identity comparison
        if (customer === targetCustomer) {
            // Append the matching customer to the list
            matchingCustomers.add(customer)
        }
    }

    // Return the list of matching customers
    return matchingCustomers
}

// Example usage
val customer1 = mapOf("name" to "John", "age" to 30, "email" to "john@example.com")
val customer2 = mapOf("name" to "Jane", "age" to 25, "email" to "jane@example.com")
val customer3 = mapOf("name" to "John", "age" to 30, "email" to "john@example.com")

val customers = listOf(customer1, customer2, customer3)

val targetCustomer = mapOf("name" to "John", "age" to 30, "email" to "john@example.com")

// Find matching customers based on identity comparison and indexing
val matchingCustomers = findMatchingCustomers(customers, targetCustomer)