/**
 * Modifies the dictionary items in patientRecords and accesses elements in the list nurseInfo.
 *
 * @param nurseName the name of the nurse.
 * @param nurseInfo a list containing nurse's information.
 * @param patientRecords a dictionary containing patient records.
 * @return The modified patientRecords dictionary.
 */
fun modifyListAndDict(nurseName: String, nurseInfo: List<String>, patientRecords: MutableMap<String, MutableMap<String, String>>): MutableMap<String, MutableMap<String, String>> {

    // Accessing elements in a list
    val nurseDutyArea = nurseInfo[2]

    // Modifying dictionary items
    for ((patientId, patientData) in patientRecords) {
        patientRecords[patientId]?.set("nurse", nurseName)
        patientRecords[patientId]?.set("duty_area", nurseDutyArea)
    }

    return patientRecords
}
/**
 * Modifies the dictionary items in patientRecords and accesses elements in the list nurseInfo.
 *
 * @param nurseName the name of the nurse.
 * @param nurseInfo a list containing nurse's information.
 * @param patientRecords a dictionary containing patient records.
 * @return The modified patientRecords dictionary.
 */
fun modifyListAndDict(nurseName: String, nurseInfo: List<String>, patientRecords: MutableMap<String, MutableMap<String, String>>): MutableMap<String, MutableMap<String, String>> {
/**
 * Modifies the dictionary items in patientRecords and accesses elements in the list nurseInfo.
 *
 * @param nurseName the name of the nurse.
 * @param nurseInfo a list containing nurse's information.
 * @param patientRecords a dictionary containing patient records.
 * @return The modified patientRecords dictionary.
 */
fun modifyListAndDict(nurseName: String, nurseInfo: List<String>, patientRecords: MutableMap<String, MutableMap<String, String>>): MutableMap<String, MutableMap<String, String>> {

    // Accessing elements in a list
    val nurseDutyArea = nurseInfo[2]

    // Modifying dictionary items
    for ((patientId, patientData) in patientRecords) {
        patientRecords[patientId]?.set("nurse", nurseName)
        patientRecords[patientId]?.set("duty_area", nurseDutyArea)
    }

    return patientRecords
}