/**
 * Returns true if the physician is available to see the patient at the requested time, false otherwise.
 *
 * @param physicianSchedule A nested tuple representing the physician's schedule. Each nested tuple contains the day of the week
 *                          as a string and a tuple of appointments for that day. Each appointment tuple consists of a string
 *                          representing the time slot and a boolean value indicating whether the physician is available or not.
 * @param patientRequest A tuple containing the day of the week as a string and the requested time slot as a string.
 * @return A boolean value indicating whether the physician is available to see the patient at the requested time.
 */
fun physicianAvailability(physicianSchedule: List<Pair<String, List<Pair<String, Boolean>>>>, patientRequest: Pair<String, String>): Boolean {

    for (day in physicianSchedule) {
        if (day.first == patientRequest.first) {
            for (appointment in day.second) {
                if (appointment.first == patientRequest.second) {
                    return appointment.second
                }
            }
        }
    }
    return false
}
/**
 * Returns true if the physician is available to see the patient at the requested time, false otherwise.
 *
 * @param physicianSchedule A nested tuple representing the physician's schedule. Each nested tuple contains the day of the week
 *                          as a string and a tuple of appointments for that day. Each appointment tuple consists of a string
 *                          representing the time slot and a boolean value indicating whether the physician is available or not.
 * @param patientRequest A tuple containing the day of the week as a string and the requested time slot as a string.
 * @return A boolean value indicating whether the physician is available to see the patient at the requested time.
 */
fun physicianAvailability(physicianSchedule: List<Pair<String, List<Pair<String, Boolean>>>>, patientRequest: Pair<String, String>): Boolean {
/**
 * Returns true if the physician is available to see the patient at the requested time, false otherwise.
 *
 * @param physicianSchedule A nested tuple representing the physician's schedule. Each nested tuple contains the day of the week
 *                          as a string and a tuple of appointments for that day. Each appointment tuple consists of a string
 *                          representing the time slot and a boolean value indicating whether the physician is available or not.
 * @param patientRequest A tuple containing the day of the week as a string and the requested time slot as a string.
 * @return A boolean value indicating whether the physician is available to see the patient at the requested time.
 */
fun physicianAvailability(physicianSchedule: List<Pair<String, List<Pair<String, Boolean>>>>, patientRequest: Pair<String, String>): Boolean {

    for (day in physicianSchedule) {
        if (day.first == patientRequest.first) {
            for (appointment in day.second) {
                if (appointment.first == patientRequest.second) {
                    return appointment.second
                }
            }
        }
    }
    return false
}