/**
 * This exercise requires iterating over a specific range and selecting common movies between two actors.
 *
 * @param actor1 Name of actor 1
 * @param actor2 Name of actor 2
 * @param movies List of movies
 * @return A list of common movies between actor1 and actor2
 */
fun commonMovies(actor1: String, actor2: String, movies: List<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    for (i in movies.indices) {
        for (j in i + 1 until movies.size) {
            if (actor1 in movies[i] && actor2 in movies[j]) {
                commonMovies.add(movies[i])
            }
        }
    }

    return commonMovies
}
/**
 * This exercise requires iterating over a specific range and selecting common movies between two actors.
 *
 * @param actor1 Name of actor 1
 * @param actor2 Name of actor 2
 * @param movies List of movies
 * @return A list of common movies between actor1 and actor2
 */
fun commonMovies(actor1: String, actor2: String, movies: List<String>): List<String> {
/**
 * This exercise requires iterating over a specific range and selecting common movies between two actors.
 *
 * @param actor1 Name of actor 1
 * @param actor2 Name of actor 2
 * @param movies List of movies
 * @return A list of common movies between actor1 and actor2
 */
fun commonMovies(actor1: String, actor2: String, movies: List<String>): List<String> {

    val commonMovies = mutableListOf<String>()

    for (i in movies.indices) {
        for (j in i + 1 until movies.size) {
            if (actor1 in movies[i] && actor2 in movies[j]) {
                commonMovies.add(movies[i])
            }
        }
    }

    return commonMovies
}