/**
 * A physician has to prescribe medications based on the patient's condition.
 * The patient_condition is a map containing the patient's symptoms.
 * The medication is a list containing the available medications.
 * Complete the code to prescribe the appropriate medication based on the patient's condition.
 *
 * @param patientCondition A map containing the patient's symptoms as keys and their severity as values.
 * @param medication A list of available medications.
 * @return The prescribed medication based on the patient's condition.
 *
 * Note:
 * - If the patient's condition requires multiple medications, return a string with all the prescribed medications separated by a comma and a space.
 * - If the patient's condition does not match any medication in the list, return "No medication available."
 * - The patientCondition will always have at least one symptom.
 */
fun prescription(patientCondition: Map<String, Int>, medication: List<String>): String {

    // Check if the patient has fever
    if (patientCondition.containsKey("fever")) {
        when {
            patientCondition["fever"]!! > 40 -> return medication[0]
            patientCondition["fever"]!! > 38 -> return medication[1]
            else -> return medication[2]
        }
    }

    return "No medication available."
}
/**
 * A physician has to prescribe medications based on the patient's condition.
 * The patient_condition is a map containing the patient's symptoms.
 * The medication is a list containing the available medications.
 * Complete the code to prescribe the appropriate medication based on the patient's condition.
 *
 * @param patientCondition A map containing the patient's symptoms as keys and their severity as values.
 * @param medication A list of available medications.
 * @return The prescribed medication based on the patient's condition.
 *
 * Note:
 * - If the patient's condition requires multiple medications, return a string with all the prescribed medications separated by a comma and a space.
 * - If the patient's condition does not match any medication in the list, return "No medication available."
 * - The patientCondition will always have at least one symptom.
 */
fun prescription(patientCondition: Map<String, Int>, medication: List<String>): String {
/**
 * A physician has to prescribe medications based on the patient's condition.
 * The patient_condition is a map containing the patient's symptoms.
 * The medication is a list containing the available medications.
 * Complete the code to prescribe the appropriate medication based on the patient's condition.
 *
 * @param patientCondition A map containing the patient's symptoms as keys and their severity as values.
 * @param medication A list of available medications.
 * @return The prescribed medication based on the patient's condition.
 *
 * Note:
 * - If the patient's condition requires multiple medications, return a string with all the prescribed medications separated by a comma and a space.
 * - If the patient's condition does not match any medication in the list, return "No medication available."
 * - The patientCondition will always have at least one symptom.
 */
fun prescription(patientCondition: Map<String, Int>, medication: List<String>): String {

    // Check if the patient has fever
    if (patientCondition.containsKey("fever")) {
        when {
            patientCondition["fever"]!! > 40 -> return medication[0]
            patientCondition["fever"]!! > 38 -> return medication[1]
            else -> return medication[2]
        }
    }

    return "No medication available."
}