/**
 * This function checks if customers belong to the target segments.
 *
 * @param customers A list containing the customer IDs.
 * @param targetSegments A list containing the target segments IDs.
 * @return A list containing the customer IDs that belong to the target segments.
 */
fun checkCustomerSegments(customers: List<Pair<Int, Int>>, targetSegments: List<Pair<Int, Int>>): List<Int> {

    val matchingCustomers = mutableListOf<Int>() // To store matching customers

    // Iterate over each customer
    for (customer in customers) {
        // Iterate over each segment
        for (segment in targetSegments) {
            // Check if the customer belongs to the target segment
            if (customer.second == segment.first) {
                matchingCustomers.add(customer.first)
                break // Exit inner loop if a match is found
            }
        }
    }

    return matchingCustomers
}
/**
 * This function checks if customers belong to the target segments.
 *
 * @param customers A list containing the customer IDs.
 * @param targetSegments A list containing the target segments IDs.
 * @return A list containing the customer IDs that belong to the target segments.
 */
fun checkCustomerSegments(customers: List<Pair<Int, Int>>, targetSegments: List<Pair<Int, Int>>): List<Int> {
/**
 * This function checks if customers belong to the target segments.
 *
 * @param customers A list containing the customer IDs.
 * @param targetSegments A list containing the target segments IDs.
 * @return A list containing the customer IDs that belong to the target segments.
 */
fun checkCustomerSegments(customers: List<Pair<Int, Int>>, targetSegments: List<Pair<Int, Int>>): List<Int> {

    val matchingCustomers = mutableListOf<Int>() // To store matching customers

    // Iterate over each customer
    for (customer in customers) {
        // Iterate over each segment
        for (segment in targetSegments) {
            // Check if the customer belongs to the target segment
            if (customer.second == segment.first) {
                matchingCustomers.add(customer.first)
                break // Exit inner loop if a match is found
            }
        }
    }

    return matchingCustomers
}