/**
 * This function takes an actor/actress's name and a dictionary of movies as arguments
 * and returns a list of movies in which the actor/actress has appeared as a lead actor/actress.
 */
fun searchMovies(actor: String, movies: Map<String, Map<String, String>>): List<String> {

    val leadMovies = mutableListOf<String>()

    for ((movie, cast) in movies) {
        if (actor in cast && cast[actor] == "Lead") {
            leadMovies.add(movie)
        }
    }

    return leadMovies
}
/**
 * This function takes an actor/actress's name and a dictionary of movies as arguments
 * and returns a list of movies in which the actor/actress has appeared as a lead actor/actress.
 */
fun searchMovies(actor: String, movies: Map<String, Map<String, String>>): List<String> {
/**
 * This function takes an actor/actress's name and a dictionary of movies as arguments
 * and returns a list of movies in which the actor/actress has appeared as a lead actor/actress.
 */
fun searchMovies(actor: String, movies: Map<String, Map<String, String>>): List<String> {

    val leadMovies = mutableListOf<String>()

    for ((movie, cast) in movies) {
        if (actor in cast && cast[actor] == "Lead") {
            leadMovies.add(movie)
        }
    }

    return leadMovies
}