/**
 * Given a list of tuples representing customer interactions and their respective scores, modify the scores using slicing.
 * Then, loop through the modified tuples and print the names of the customers with scores greater than 80.
 *
 * @param data A list of tuples where each tuple contains the customer name (string) and their interaction score (integer).
 */
fun interactionStats(data: MutableList<Pair<String, Any>>) {

    // Replace the scores of customers with 'Superior' if their score is less than or equal to 50
    data.subList(0, 5).forEachIndexed { index, (name, score) ->
        if (score is Int && score <= 50) {
            data[index] = Pair(name, "Superior")
        }
    }

    // Loop through the tuples and print the names of customers with scores greater than 80
    data.forEach { (name, score) ->
        if (score is Int && score > 80) {
            println(name)
        }
    }
}
/**
 * Given a list of tuples representing customer interactions and their respective scores, modify the scores using slicing.
 * Then, loop through the modified tuples and print the names of the customers with scores greater than 80.
 *
 * @param data A list of tuples where each tuple contains the customer name (string) and their interaction score (integer).
 */
fun interactionStats(data: MutableList<Pair<String, Any>>) {
/**
 * Given a list of tuples representing customer interactions and their respective scores, modify the scores using slicing.
 * Then, loop through the modified tuples and print the names of the customers with scores greater than 80.
 *
 * @param data A list of tuples where each tuple contains the customer name (string) and their interaction score (integer).
 */
fun interactionStats(data: MutableList<Pair<String, Any>>) {

    // Replace the scores of customers with 'Superior' if their score is less than or equal to 50
    data.subList(0, 5).forEachIndexed { index, (name, score) ->
        if (score is Int && score <= 50) {
            data[index] = Pair(name, "Superior")
        }
    }

    // Loop through the tuples and print the names of customers with scores greater than 80
    data.forEach { (name, score) ->
        if (score is Int && score > 80) {
            println(name)
        }
    }
}