/**
 * This function finds the common movies between two actors.
 *
 * @param actor1 List of movies that actor1 has worked in.
 * @param actor2 List of movies that actor2 has worked in.
 * @return Set of movies that both actors have worked in.
 */
fun findCommonMovies(actor1: List<String>, actor2: List<String>): Set<String> {

    // Convert the lists into sets for efficient intersection operation
    val setActor1 = actor1.toSet()
    val setActor2 = actor2.toSet()

    // Find the intersection of the two sets
    val commonMovies = setActor1.intersect(setActor2)

    return commonMovies
}
/**
 * This function finds the common movies between two actors.
 *
 * @param actor1 List of movies that actor1 has worked in.
 * @param actor2 List of movies that actor2 has worked in.
 * @return Set of movies that both actors have worked in.
 */
fun findCommonMovies(actor1: List<String>, actor2: List<String>): Set<String> {
/**
 * This function finds the common movies between two actors.
 *
 * @param actor1 List of movies that actor1 has worked in.
 * @param actor2 List of movies that actor2 has worked in.
 * @return Set of movies that both actors have worked in.
 */
fun findCommonMovies(actor1: List<String>, actor2: List<String>): Set<String> {

    // Convert the lists into sets for efficient intersection operation
    val setActor1 = actor1.toSet()
    val setActor2 = actor2.toSet()

    // Find the intersection of the two sets
    val commonMovies = setActor1.intersect(setActor2)

    return commonMovies
}