/**
 * Given a list of patients and their medical conditions, update the patient data based on certain conditions.
 *
 * @param patients List of patients
 * @param medicalConditions Dictionary mapping patient names to medical conditions
 * @return Updated list of patients with modified medical conditions
 */
fun updatePatientData(patients: List<String>, medicalConditions: MutableMap<String, String>): List<String> {

    // Iterate over each patient in the list
    for (patient in patients) {
        // Check if the patient has a medical condition
        if (patient in medicalConditions) {
            // Get the patient's medical condition
            var condition = medicalConditions[patient]

            // Modify the medical condition based on certain conditions
            condition = when (condition) {
                "Fever" -> "Common Cold"
                "Headache" -> "Migraine"
                "Cough" -> "Bronchitis"
                "Rash" -> "Allergic Reaction"
                else -> "Unknown Condition"
            }

            // Update the medical condition in the dictionary
            medicalConditions[patient] = condition
        }
    }

    return patients
}
/**
 * Given a list of patients and their medical conditions, update the patient data based on certain conditions.
 *
 * @param patients List of patients
 * @param medicalConditions Dictionary mapping patient names to medical conditions
 * @return Updated list of patients with modified medical conditions
 */
fun updatePatientData(patients: List<String>, medicalConditions: MutableMap<String, String>): List<String> {
/**
 * Given a list of patients and their medical conditions, update the patient data based on certain conditions.
 *
 * @param patients List of patients
 * @param medicalConditions Dictionary mapping patient names to medical conditions
 * @return Updated list of patients with modified medical conditions
 */
fun updatePatientData(patients: List<String>, medicalConditions: MutableMap<String, String>): List<String> {

    // Iterate over each patient in the list
    for (patient in patients) {
        // Check if the patient has a medical condition
        if (patient in medicalConditions) {
            // Get the patient's medical condition
            var condition = medicalConditions[patient]

            // Modify the medical condition based on certain conditions
            condition = when (condition) {
                "Fever" -> "Common Cold"
                "Headache" -> "Migraine"
                "Cough" -> "Bronchitis"
                "Rash" -> "Allergic Reaction"
                else -> "Unknown Condition"
            }

            // Update the medical condition in the dictionary
            medicalConditions[patient] = condition
        }
    }

    return patients
}