/**
 * A function to find common movies between two actors
 *
 * @param actor1 The name of the first actor
 * @param actor2 The name of the second actor
 * @param movies A dictionary where each key represents the name of a movie and each value is a set
 * containing the names of actors who starred in that movie
 * @return A set of common movies between the two actors
 */
fun findCommonMovies(actor1: String, actor2: String, movies: Map<String, Set<String>>): Set<String> {

    val commonMovies = mutableSetOf<String>()

    for ((movie, actors) in movies) {
        if (actor1 in actors && actor2 in actors) {
            commonMovies.add(movie)
        }
    }

    return commonMovies
}
/**
 * A function to find common movies between two actors
 *
 * @param actor1 The name of the first actor
 * @param actor2 The name of the second actor
 * @param movies A dictionary where each key represents the name of a movie and each value is a set
 * containing the names of actors who starred in that movie
 * @return A set of common movies between the two actors
 */
fun findCommonMovies(actor1: String, actor2: String, movies: Map<String, Set<String>>): Set<String> {
/**
 * A function to find common movies between two actors
 *
 * @param actor1 The name of the first actor
 * @param actor2 The name of the second actor
 * @param movies A dictionary where each key represents the name of a movie and each value is a set
 * containing the names of actors who starred in that movie
 * @return A set of common movies between the two actors
 */
fun findCommonMovies(actor1: String, actor2: String, movies: Map<String, Set<String>>): Set<String> {

    val commonMovies = mutableSetOf<String>()

    for ((movie, actors) in movies) {
        if (actor1 in actors && actor2 in actors) {
            commonMovies.add(movie)
        }
    }

    return commonMovies
}