/**
 * Given a list of dancers, and a start and end index, calculate the average dance score
 * for the dancers within the specified slice of the list.
 *
 * @param dancers A list containing the dance scores of the dancers.
 * @param start_index The starting index for the slice.
 * @param end_index The ending index for the slice.
 * @return The average dance score for the dancers within the specified slice.
 */
fun calcAverageDanceScore(dancers: List<Int>, start_index: Int, end_index: Int): Double {

    // Slice the list of dancers to obtain the specified range
    val slicedDancers = dancers.subList(start_index, end_index)

    // Calculate the sum of the dance scores using sumBy
    val totalScore = slicedDancers.sum()

    // Calculate the average dance score by dividing the total score by the number of dancers
    val averageScore = totalScore.toDouble() / slicedDancers.size

    return averageScore
}
/**
 * Given a list of dancers, and a start and end index, calculate the average dance score
 * for the dancers within the specified slice of the list.
 *
 * @param dancers A list containing the dance scores of the dancers.
 * @param start_index The starting index for the slice.
 * @param end_index The ending index for the slice.
 * @return The average dance score for the dancers within the specified slice.
 */
fun calcAverageDanceScore(dancers: List<Int>, start_index: Int, end_index: Int): Double {
/**
 * Given a list of dancers, and a start and end index, calculate the average dance score
 * for the dancers within the specified slice of the list.
 *
 * @param dancers A list containing the dance scores of the dancers.
 * @param start_index The starting index for the slice.
 * @param end_index The ending index for the slice.
 * @return The average dance score for the dancers within the specified slice.
 */
fun calcAverageDanceScore(dancers: List<Int>, start_index: Int, end_index: Int): Double {

    // Slice the list of dancers to obtain the specified range
    val slicedDancers = dancers.subList(start_index, end_index)

    // Calculate the sum of the dance scores using sumBy
    val totalScore = slicedDancers.sum()

    // Calculate the average dance score by dividing the total score by the number of dancers
    val averageScore = totalScore.toDouble() / slicedDancers.size

    return averageScore
}