/**
 * A dance battle between two dancers.
 *
 * @param dancer1 The name of the first dancer.
 * @param dancer2 The name of the second dancer.
 * @return A list containing the intersection of the consecutive integers from 1 to 1000
 * and the sum of ASCII values for each character in the names of both dancers.
 */
fun danceBattle(dancer1: String, dancer2: String): List<Int> {

    // Initialize an empty list to store the intersection
    val intersection = mutableListOf<Int>()

    // Iterate through consecutive integers from 1 to 1000
    for (i in 1..1000) {
        // Calculate the sum of ASCII values for each character in the names of both dancers
        val asciiSumDancer1 = dancer1.sumBy { it.toInt() }
        val asciiSumDancer2 = dancer2.sumBy { it.toInt() }

        // Check if the integer is present in both ASCII sums
        if (i == asciiSumDancer1 || i == asciiSumDancer2) {
            // Add the integer to the intersection list
            intersection.add(i)
        }
    }

    return intersection
}
/**
 * A dance battle between two dancers.
 *
 * @param dancer1 The name of the first dancer.
 * @param dancer2 The name of the second dancer.
 * @return A list containing the intersection of the consecutive integers from 1 to 1000
 * and the sum of ASCII values for each character in the names of both dancers.
 */
fun danceBattle(dancer1: String, dancer2: String): List<Int> {
/**
 * A dance battle between two dancers.
 *
 * @param dancer1 The name of the first dancer.
 * @param dancer2 The name of the second dancer.
 * @return A list containing the intersection of the consecutive integers from 1 to 1000
 * and the sum of ASCII values for each character in the names of both dancers.
 */
fun danceBattle(dancer1: String, dancer2: String): List<Int> {

    // Initialize an empty list to store the intersection
    val intersection = mutableListOf<Int>()

    // Iterate through consecutive integers from 1 to 1000
    for (i in 1..1000) {
        // Calculate the sum of ASCII values for each character in the names of both dancers
        val asciiSumDancer1 = dancer1.sumBy { it.toInt() }
        val asciiSumDancer2 = dancer2.sumBy { it.toInt() }

        // Check if the integer is present in both ASCII sums
        if (i == asciiSumDancer1 || i == asciiSumDancer2) {
            // Add the integer to the intersection list
            intersection.add(i)
        }
    }

    return intersection
}