/**
 * Given a dictionary of actor/actress information, modify the specified element of the dictionary using slicing.
 *
 * @param actorInfo A dictionary containing actor/actress information.
 * @param index The index of the element to be modified.
 * @param newInfo The new information to replace the existing element.
 * @return The modified dictionary with the specified element updated.
 */
fun modifyActorInfo(actorInfo: MutableMap<String, String>, index: Int, newInfo: String): MutableMap<String, String> {

    val actorInfoKeys = actorInfo.keys.toList()

    if (index < 0 || index >= actorInfoKeys.size) {
        throw IndexOutOfBoundsException("Invalid index!")
    }

    actorInfo[actorInfoKeys[index]] = newInfo

    return actorInfo
}
/**
 * Given a dictionary of actor/actress information, modify the specified element of the dictionary using slicing.
 *
 * @param actorInfo A dictionary containing actor/actress information.
 * @param index The index of the element to be modified.
 * @param newInfo The new information to replace the existing element.
 * @return The modified dictionary with the specified element updated.
 */
fun modifyActorInfo(actorInfo: MutableMap<String, String>, index: Int, newInfo: String): MutableMap<String, String> {
/**
 * Given a dictionary of actor/actress information, modify the specified element of the dictionary using slicing.
 *
 * @param actorInfo A dictionary containing actor/actress information.
 * @param index The index of the element to be modified.
 * @param newInfo The new information to replace the existing element.
 * @return The modified dictionary with the specified element updated.
 */
fun modifyActorInfo(actorInfo: MutableMap<String, String>, index: Int, newInfo: String): MutableMap<String, String> {

    val actorInfoKeys = actorInfo.keys.toList()

    if (index < 0 || index >= actorInfoKeys.size) {
        throw IndexOutOfBoundsException("Invalid index!")
    }

    actorInfo[actorInfoKeys[index]] = newInfo

    return actorInfo
}