/**
 * Given a list of nurse IDs and a dictionary representing the history of patients attended by each nurse,
 * find the next available nurse who has not attended any of the patients in the patient history.
 *
 * @param nurseRoster A list of nurse IDs.
 * @param patientHistory A dictionary where the keys are patient names and the values are the nurse IDs who attended them.
 * @return The ID of the next available nurse who has not attended any patient in the history.
 *         Returns null if all nurses have attended at least one patient in the history.
 */
fun findNextPatient(nurseRoster: List<String>, patientHistory: Map<String, String>): String? {

    // Iterate through the nurse roster
    for (nurseId in nurseRoster) {
        val attendedPatients = patientHistory.values.toList()

        // Check if the nurse attended any patient
        if (nurseId !in attendedPatients) {
            return nurseId
        }
    }

    // All nurses have attended at least one patient in the history
    return null
}
/**
 * Given a list of nurse IDs and a dictionary representing the history of patients attended by each nurse,
 * find the next available nurse who has not attended any of the patients in the patient history.
 *
 * @param nurseRoster A list of nurse IDs.
 * @param patientHistory A dictionary where the keys are patient names and the values are the nurse IDs who attended them.
 * @return The ID of the next available nurse who has not attended any patient in the history.
 *         Returns null if all nurses have attended at least one patient in the history.
 */
fun findNextPatient(nurseRoster: List<String>, patientHistory: Map<String, String>): String? {
/**
 * Given a list of nurse IDs and a dictionary representing the history of patients attended by each nurse,
 * find the next available nurse who has not attended any of the patients in the patient history.
 *
 * @param nurseRoster A list of nurse IDs.
 * @param patientHistory A dictionary where the keys are patient names and the values are the nurse IDs who attended them.
 * @return The ID of the next available nurse who has not attended any patient in the history.
 *         Returns null if all nurses have attended at least one patient in the history.
 */
fun findNextPatient(nurseRoster: List<String>, patientHistory: Map<String, String>): String? {

    // Iterate through the nurse roster
    for (nurseId in nurseRoster) {
        val attendedPatients = patientHistory.values.toList()

        // Check if the nurse attended any patient
        if (nurseId !in attendedPatients) {
            return nurseId
        }
    }

    // All nurses have attended at least one patient in the history
    return null
}