/**
 * Given the name of an actor/actress and their schedule, 
 * check if they are available on a specific date and time.
 *
 * @param name The name of the actor/actress.
 * @param schedule A map representing their schedule, 
 *                 where the keys are dates (YYYY-MM-DD) and 
 *                 the values are lists of times (HH:MM).
 * @return True if the actor/actress is available, False otherwise.
 */
fun checkAvailability(name: String, schedule: Map<String, List<String>>): Boolean {

    // Check if the actor/actress has any scheduled dates
    if (!schedule.containsKey(name)) {
        return false
    }
    
    // Prompt the user to input the desired date and time
    print("Enter the date (YYYY-MM-DD): ")
    val date = readLine() ?: ""
    print("Enter the time (HH:MM): ")
    val time = readLine() ?: ""
    
    // Check if the desired date is in the schedule
    if (!schedule.containsKey(date)) {
        return false
    }
    
    // Check if the desired time is in the schedule
    if (!schedule[date]!!.contains(time)) {
        return false
    }
    
    // Actor/actress is available at the specified date and time
    return true
}

// Example usage
/**
 * Given the name of an actor/actress and their schedule, 
 * check if they are available on a specific date and time.
 *
 * @param name The name of the actor/actress.
 * @param schedule A map representing their schedule, 
 *                 where the keys are dates (YYYY-MM-DD) and 
 *                 the values are lists of times (HH:MM).
 * @return True if the actor/actress is available, False otherwise.
 */
fun checkAvailability(name: String, schedule: Map<String, List<String>>): Boolean {
/**
 * Given the name of an actor/actress and their schedule, 
 * check if they are available on a specific date and time.
 *
 * @param name The name of the actor/actress.
 * @param schedule A map representing their schedule, 
 *                 where the keys are dates (YYYY-MM-DD) and 
 *                 the values are lists of times (HH:MM).
 * @return True if the actor/actress is available, False otherwise.
 */
fun checkAvailability(name: String, schedule: Map<String, List<String>>): Boolean {

    // Check if the actor/actress has any scheduled dates
    if (!schedule.containsKey(name)) {
        return false
    }
    
    // Prompt the user to input the desired date and time
    print("Enter the date (YYYY-MM-DD): ")
    val date = readLine() ?: ""
    print("Enter the time (HH:MM): ")
    val time = readLine() ?: ""
    
    // Check if the desired date is in the schedule
    if (!schedule.containsKey(date)) {
        return false
    }
    
    // Check if the desired time is in the schedule
    if (!schedule[date]!!.contains(time)) {
        return false
    }
    
    // Actor/actress is available at the specified date and time
    return true
}

// Example usage