/**
 * Given a dictionary of appointments with doctors as keys and a specific doctor,
 * iterate over the appointments and delete all the appointments of that doctor.
 *
 * @param appointments A dictionary with doctors as keys and appointments as values
 * @param doctor The specific doctor whose appointments need to be deleted
 * @return Updated dictionary after deleting the doctor's appointments
 */
fun deleteDoctorsAppointments(appointments: MutableMap<String, String>, doctor: String): MutableMap<String, String> {

    val iterator = appointments.keys.iterator()
    while (iterator.hasNext()) {
        val key = iterator.next()
        if (key == doctor) {
            iterator.remove()
        }
    }
    return appointments
}
/**
 * Given a dictionary of appointments with doctors as keys and a specific doctor,
 * iterate over the appointments and delete all the appointments of that doctor.
 *
 * @param appointments A dictionary with doctors as keys and appointments as values
 * @param doctor The specific doctor whose appointments need to be deleted
 * @return Updated dictionary after deleting the doctor's appointments
 */
fun deleteDoctorsAppointments(appointments: MutableMap<String, String>, doctor: String): MutableMap<String, String> {
/**
 * Given a dictionary of appointments with doctors as keys and a specific doctor,
 * iterate over the appointments and delete all the appointments of that doctor.
 *
 * @param appointments A dictionary with doctors as keys and appointments as values
 * @param doctor The specific doctor whose appointments need to be deleted
 * @return Updated dictionary after deleting the doctor's appointments
 */
fun deleteDoctorsAppointments(appointments: MutableMap<String, String>, doctor: String): MutableMap<String, String> {

    val iterator = appointments.keys.iterator()
    while (iterator.hasNext()) {
        val key = iterator.next()
        if (key == doctor) {
            iterator.remove()
        }
    }
    return appointments
}