/**
 * Given an actor/actress name and a list of movies,
 * add each movie to the actor's movies list and return the updated list.
 *
 * @param actor The name of the actor/actress.
 * @param movies A list of movies.
 * @return The updated movies list after appending movies for the actor.
 */
fun addMovies(actor: String, movies: List<String>): List<String> {

    // Initialize an empty list to store the actor's movies
    val actorMovies = mutableListOf<String>()
    
    // Iterate over each movie in the given list
    for (movie in movies) {
        // Check if the movie is already in the actor's movies list
        if (movie !in actorMovies) {
            // If not, append the movie to the actor's movies list
            actorMovies.add(movie)
        }
    }
    
    // Return the updated movies list for the actor
    return actorMovies
}
/**
 * Given an actor/actress name and a list of movies,
 * add each movie to the actor's movies list and return the updated list.
 *
 * @param actor The name of the actor/actress.
 * @param movies A list of movies.
 * @return The updated movies list after appending movies for the actor.
 */
fun addMovies(actor: String, movies: List<String>): List<String> {
/**
 * Given an actor/actress name and a list of movies,
 * add each movie to the actor's movies list and return the updated list.
 *
 * @param actor The name of the actor/actress.
 * @param movies A list of movies.
 * @return The updated movies list after appending movies for the actor.
 */
fun addMovies(actor: String, movies: List<String>): List<String> {

    // Initialize an empty list to store the actor's movies
    val actorMovies = mutableListOf<String>()
    
    // Iterate over each movie in the given list
    for (movie in movies) {
        // Check if the movie is already in the actor's movies list
        if (movie !in actorMovies) {
            // If not, append the movie to the actor's movies list
            actorMovies.add(movie)
        }
    }
    
    // Return the updated movies list for the actor
    return actorMovies
}