/**
 * Given the name of an actor/actress and a list of pairs representing actors/actresses with their respective roles,
 * modify the list to replace the character role of the given actor/actress with a new one.
 *
 * @param actorName The name of the actor/actress to modify.
 * @param actors A list of pairs representing actors/actresses with their respective roles.
 * @return The modified list of pairs with the updated character role.
 */
fun modifyActor(actorName: String, actors: List<Pair<String, String>>): List<Pair<String, String>> {

    // Find the index of the actor/actress in the list
    var index = 0
    for (i in actors.indices) {
        if (actors[i].first.equals(actorName, ignoreCase = true)) {
            index = i
            break
        }
    }

    // Modify the character role of the given actor/actress
    val modifiedActors = actors.toMutableList()
    modifiedActors[index] = Pair(modifiedActors[index].first, "NEW_ROLE")

    return modifiedActors
}
/**
 * Given the name of an actor/actress and a list of pairs representing actors/actresses with their respective roles,
 * modify the list to replace the character role of the given actor/actress with a new one.
 *
 * @param actorName The name of the actor/actress to modify.
 * @param actors A list of pairs representing actors/actresses with their respective roles.
 * @return The modified list of pairs with the updated character role.
 */
fun modifyActor(actorName: String, actors: List<Pair<String, String>>): List<Pair<String, String>> {
/**
 * Given the name of an actor/actress and a list of pairs representing actors/actresses with their respective roles,
 * modify the list to replace the character role of the given actor/actress with a new one.
 *
 * @param actorName The name of the actor/actress to modify.
 * @param actors A list of pairs representing actors/actresses with their respective roles.
 * @return The modified list of pairs with the updated character role.
 */
fun modifyActor(actorName: String, actors: List<Pair<String, String>>): List<Pair<String, String>> {

    // Find the index of the actor/actress in the list
    var index = 0
    for (i in actors.indices) {
        if (actors[i].first.equals(actorName, ignoreCase = true)) {
            index = i
            break
        }
    }

    // Modify the character role of the given actor/actress
    val modifiedActors = actors.toMutableList()
    modifiedActors[index] = Pair(modifiedActors[index].first, "NEW_ROLE")

    return modifiedActors
}