/**
 * Given an actor/actress and a dictionary of movies and their roles,
 * the function counts the number of movies in which the actor/actress
 * appears.
 *
 * @param actor The name of the actor/actress.
 * @param movies A dictionary where the keys are movie names and the values are lists of roles.
 * @return The number of movies the actor/actress appears in.
 */
fun countRoles(actor: String, movies: Map<String, List<String>>): Int {

    var count = 0

    for ((_, roles) in movies) {
        if (actor in roles) {
            count++
        }
    }

    return count
}
/**
 * Given an actor/actress and a dictionary of movies and their roles,
 * the function counts the number of movies in which the actor/actress
 * appears.
 *
 * @param actor The name of the actor/actress.
 * @param movies A dictionary where the keys are movie names and the values are lists of roles.
 * @return The number of movies the actor/actress appears in.
 */
fun countRoles(actor: String, movies: Map<String, List<String>>): Int {
/**
 * Given an actor/actress and a dictionary of movies and their roles,
 * the function counts the number of movies in which the actor/actress
 * appears.
 *
 * @param actor The name of the actor/actress.
 * @param movies A dictionary where the keys are movie names and the values are lists of roles.
 * @return The number of movies the actor/actress appears in.
 */
fun countRoles(actor: String, movies: Map<String, List<String>>): Int {

    var count = 0

    for ((_, roles) in movies) {
        if (actor in roles) {
            count++
        }
    }

    return count
}