/**
 * Given a list of patients, remove all patients from the physician's patient list who have no appointments.
 *
 * @param physician The name of the physician.
 * @param patients A list of pairs representing patients. Each pair contains the patient's name and a list of appointments.
 * @return A modified list of patients for the physician, removing patients without appointments.
 *
 * Examples:
 * physician = "Dr. Smith"
 * patients = [("John Doe", emptyList()), ("Jane Smith", listOf("2021-04-15", "2021-04-20")), ("Bob Johnson", listOf("2021-04-16"))]
 * removePatients(physician, patients) // Output: [("Jane Smith", ["2021-04-15", "2021-04-20"]), ("Bob Johnson", ["2021-04-16"])]
 */
fun removePatients(physician: String, patients: List<Pair<String, List<String>>>): List<Pair<String, List<String>>> {

    val result = mutableListOf<Pair<String, List<String>>>()
    for (patient in patients) {
        if (patient.second.isNotEmpty()) { // Check if patient has appointments
            result.add(patient)
        }
    }
    return result
}
/**
 * Given a list of patients, remove all patients from the physician's patient list who have no appointments.
 *
 * @param physician The name of the physician.
 * @param patients A list of pairs representing patients. Each pair contains the patient's name and a list of appointments.
 * @return A modified list of patients for the physician, removing patients without appointments.
 *
 * Examples:
 * physician = "Dr. Smith"
 * patients = [("John Doe", emptyList()), ("Jane Smith", listOf("2021-04-15", "2021-04-20")), ("Bob Johnson", listOf("2021-04-16"))]
 * removePatients(physician, patients) // Output: [("Jane Smith", ["2021-04-15", "2021-04-20"]), ("Bob Johnson", ["2021-04-16"])]
 */
fun removePatients(physician: String, patients: List<Pair<String, List<String>>>): List<Pair<String, List<String>>> {
/**
 * Given a list of patients, remove all patients from the physician's patient list who have no appointments.
 *
 * @param physician The name of the physician.
 * @param patients A list of pairs representing patients. Each pair contains the patient's name and a list of appointments.
 * @return A modified list of patients for the physician, removing patients without appointments.
 *
 * Examples:
 * physician = "Dr. Smith"
 * patients = [("John Doe", emptyList()), ("Jane Smith", listOf("2021-04-15", "2021-04-20")), ("Bob Johnson", listOf("2021-04-16"))]
 * removePatients(physician, patients) // Output: [("Jane Smith", ["2021-04-15", "2021-04-20"]), ("Bob Johnson", ["2021-04-16"])]
 */
fun removePatients(physician: String, patients: List<Pair<String, List<String>>>): List<Pair<String, List<String>>> {

    val result = mutableListOf<Pair<String, List<String>>>()
    for (patient in patients) {
        if (patient.second.isNotEmpty()) { // Check if patient has appointments
            result.add(patient)
        }
    }
    return result
}