/**
 * Given two lists of movies in which two actors have acted,
 * find the common movies in which they have both acted using nested loops
 */
fun findCommonMovies(actor1: List<String>, actor2: List<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    for (movie1 in actor1) {
        for (movie2 in actor2) {
            if (movie1 == movie2 && movie1 !in commonMovies) {
                commonMovies.add(movie1)
            }
        }
    }

    return commonMovies
}
/**
 * Given two lists of movies in which two actors have acted,
 * find the common movies in which they have both acted using nested loops
 */
fun findCommonMovies(actor1: List<String>, actor2: List<String>): List<String> {
/**
 * Given two lists of movies in which two actors have acted,
 * find the common movies in which they have both acted using nested loops
 */
fun findCommonMovies(actor1: List<String>, actor2: List<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    for (movie1 in actor1) {
        for (movie2 in actor2) {
            if (movie1 == movie2 && movie1 !in commonMovies) {
                commonMovies.add(movie1)
            }
        }
    }

    return commonMovies
}