/**
 * Modify the dancer at the given index in the dancer_list.
 *
 * @param dancerList A list of dancers.
 * @param index The index of the dancer to be modified.
 * @return The modified dancerList.
 * @throws IndexOutOfBoundsException If the index is out of range.
 */
fun modifyDancer(dancerList: MutableList<Map<String, Any>>, index: Int): MutableList<Map<String, Any>> {

    if (index < 0 || index >= dancerList.size) {
        throw IndexOutOfBoundsException("Index out of range")
    }

    val dancer = dancerList[index]

    if (dancer != null) {
        // Modify the dancer's attributes here
        // Example: dancer["name"] = "New Name"
        // Example: dancer["age"] = 25
        // Example: dancer["score"] = (dancer["score"] as Int) + 10

        // Modify the dancerList with the modified dancer
        dancerList[index] = dancer
    }

    return dancerList
}
/**
 * Modify the dancer at the given index in the dancer_list.
 *
 * @param dancerList A list of dancers.
 * @param index The index of the dancer to be modified.
 * @return The modified dancerList.
 * @throws IndexOutOfBoundsException If the index is out of range.
 */
fun modifyDancer(dancerList: MutableList<Map<String, Any>>, index: Int): MutableList<Map<String, Any>> {
/**
 * Modify the dancer at the given index in the dancer_list.
 *
 * @param dancerList A list of dancers.
 * @param index The index of the dancer to be modified.
 * @return The modified dancerList.
 * @throws IndexOutOfBoundsException If the index is out of range.
 */
fun modifyDancer(dancerList: MutableList<Map<String, Any>>, index: Int): MutableList<Map<String, Any>> {

    if (index < 0 || index >= dancerList.size) {
        throw IndexOutOfBoundsException("Index out of range")
    }

    val dancer = dancerList[index]

    if (dancer != null) {
        // Modify the dancer's attributes here
        // Example: dancer["name"] = "New Name"
        // Example: dancer["age"] = 25
        // Example: dancer["score"] = (dancer["score"] as Int) + 10

        // Modify the dancerList with the modified dancer
        dancerList[index] = dancer
    }

    return dancerList
}