/**
 * Given two lists actingMovies1 and actingMovies2, find the first movie in common between both actors.
 *
 * @param actor1 List of movies in which actor1 has acted
 * @param actor2 List of movies in which actor2 has acted
 * @return The first movie in common between actor1 and actor2
 *
 * Example:
 * findFirstCommonMovie(listOf("Movie A", "Movie B", "Movie C"), listOf("Movie B", "Movie C", "Movie D"))
 * Output: 'Movie B'
 */
fun findFirstCommonMovie(actor1: List<String>, actor2: List<String>): String? {

    for (movie1 in actor1) {
        for (movie2 in actor2) {
            if (movie1 == movie2) {
                return movie1
            }
        }
    }
    return null
}
/**
 * Given two lists actingMovies1 and actingMovies2, find the first movie in common between both actors.
 *
 * @param actor1 List of movies in which actor1 has acted
 * @param actor2 List of movies in which actor2 has acted
 * @return The first movie in common between actor1 and actor2
 *
 * Example:
 * findFirstCommonMovie(listOf("Movie A", "Movie B", "Movie C"), listOf("Movie B", "Movie C", "Movie D"))
 * Output: 'Movie B'
 */
fun findFirstCommonMovie(actor1: List<String>, actor2: List<String>): String? {
/**
 * Given two lists actingMovies1 and actingMovies2, find the first movie in common between both actors.
 *
 * @param actor1 List of movies in which actor1 has acted
 * @param actor2 List of movies in which actor2 has acted
 * @return The first movie in common between actor1 and actor2
 *
 * Example:
 * findFirstCommonMovie(listOf("Movie A", "Movie B", "Movie C"), listOf("Movie B", "Movie C", "Movie D"))
 * Output: 'Movie B'
 */
fun findFirstCommonMovie(actor1: List<String>, actor2: List<String>): String? {

    for (movie1 in actor1) {
        for (movie2 in actor2) {
            if (movie1 == movie2) {
                return movie1
            }
        }
    }
    return null
}