/**
 * This function takes in two actor's names and their respective lists of movies.
 * It returns a list of common movies that both actors have acted in.
 */
fun findCommonMovies(actor1: String, movies1: List<String>, actor2: String, movies2: List<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    for (movie1 in movies1) {
        for (movie2 in movies2) {
            if (movie1 == movie2 && movie1 !in commonMovies) {
                commonMovies.add(movie1)
            }
        }
    }

    return commonMovies
}
/**
 * This function takes in two actor's names and their respective lists of movies.
 * It returns a list of common movies that both actors have acted in.
 */
fun findCommonMovies(actor1: String, movies1: List<String>, actor2: String, movies2: List<String>): List<String> {
/**
 * This function takes in two actor's names and their respective lists of movies.
 * It returns a list of common movies that both actors have acted in.
 */
fun findCommonMovies(actor1: String, movies1: List<String>, actor2: String, movies2: List<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    for (movie1 in movies1) {
        for (movie2 in movies2) {
            if (movie1 == movie2 && movie1 !in commonMovies) {
                commonMovies.add(movie1)
            }
        }
    }

    return commonMovies
}