/**
 * Given a list of movies an actor has worked on and a list of new movies to add,
 * the function copies the original list, modifies it by adding the new movies to the copy,
 * and returns the modified copy.
 *
 * @param actor A list of movies an actor has worked on.
 * @param newMovies A list of new movies to add.
 * @return The modified copy of the original list with the new movies added.
 */
fun copyAndModifyList(actor: List<String>, newMovies: List<String>): List<String> {

    // Create a shallow copy of the original list
    val actorCopy = actor.toMutableList()

    // Add the new movies to the copied list
    actorCopy.addAll(newMovies)

    return actorCopy
}
/**
 * Given a list of movies an actor has worked on and a list of new movies to add,
 * the function copies the original list, modifies it by adding the new movies to the copy,
 * and returns the modified copy.
 *
 * @param actor A list of movies an actor has worked on.
 * @param newMovies A list of new movies to add.
 * @return The modified copy of the original list with the new movies added.
 */
fun copyAndModifyList(actor: List<String>, newMovies: List<String>): List<String> {
/**
 * Given a list of movies an actor has worked on and a list of new movies to add,
 * the function copies the original list, modifies it by adding the new movies to the copy,
 * and returns the modified copy.
 *
 * @param actor A list of movies an actor has worked on.
 * @param newMovies A list of new movies to add.
 * @return The modified copy of the original list with the new movies added.
 */
fun copyAndModifyList(actor: List<String>, newMovies: List<String>): List<String> {

    // Create a shallow copy of the original list
    val actorCopy = actor.toMutableList()

    // Add the new movies to the copied list
    actorCopy.addAll(newMovies)

    return actorCopy
}