/**
 * This function takes in two actors/actresses and a set of movies in which they have acted. It returns a list of movies
 * which are common between the two actors.
 *
 * @param actor1 The name of the first actor.
 * @param actor2 The name of the second actor.
 * @param movies A set of movies in which the actors have acted.
 * @return A list of movies that both actors have acted in.
 *
 * Example:
 * actor1 = "Tom Hanks"
 * actor2 = "Julia Roberts"
 * movies = setOf("The Terminal", "Sleepless in Seattle", "Erin Brockovich", "Forrest Gump")
 * findCommonMovies(actor1, actor2, movies) // Output: []
 */
fun findCommonMovies(actor1: String, actor2: String, movies: Set<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    // Iterate through each movie in the set of movies
    for (movie in movies) {
        // Check if both actors have acted in the current movie
        if (actor1 in movie && actor2 in movie) {
            // Append the movie to the commonMovies list
            commonMovies.add(movie)
        }
    }

    return commonMovies
}
/**
 * This function takes in two actors/actresses and a set of movies in which they have acted. It returns a list of movies
 * which are common between the two actors.
 *
 * @param actor1 The name of the first actor.
 * @param actor2 The name of the second actor.
 * @param movies A set of movies in which the actors have acted.
 * @return A list of movies that both actors have acted in.
 *
 * Example:
 * actor1 = "Tom Hanks"
 * actor2 = "Julia Roberts"
 * movies = setOf("The Terminal", "Sleepless in Seattle", "Erin Brockovich", "Forrest Gump")
 * findCommonMovies(actor1, actor2, movies) // Output: []
 */
fun findCommonMovies(actor1: String, actor2: String, movies: Set<String>): List<String> {
/**
 * This function takes in two actors/actresses and a set of movies in which they have acted. It returns a list of movies
 * which are common between the two actors.
 *
 * @param actor1 The name of the first actor.
 * @param actor2 The name of the second actor.
 * @param movies A set of movies in which the actors have acted.
 * @return A list of movies that both actors have acted in.
 *
 * Example:
 * actor1 = "Tom Hanks"
 * actor2 = "Julia Roberts"
 * movies = setOf("The Terminal", "Sleepless in Seattle", "Erin Brockovich", "Forrest Gump")
 * findCommonMovies(actor1, actor2, movies) // Output: []
 */
fun findCommonMovies(actor1: String, actor2: String, movies: Set<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    // Iterate through each movie in the set of movies
    for (movie in movies) {
        // Check if both actors have acted in the current movie
        if (actor1 in movie && actor2 in movie) {
            // Append the movie to the commonMovies list
            commonMovies.add(movie)
        }
    }

    return commonMovies
}