/**
 * A veterinarian is trying to diagnose the health condition of a pet based on its symptoms and weight.
 *
 * @param symptoms A list of symptoms exhibited by the pet.
 * @param weight The weight of the pet in pounds.
 * @return The diagnosis based on the given conditions:
 * - If the pet is heavy (weight >= 50) and has a cough symptom, return "Pneumonia".
 * - If the pet is heavy (weight >= 50) and does not have a cough symptom, return "Obesity".
 * - If the pet is light (weight < 50) and has a cough symptom, return "Bronchitis".
 * - If the pet is light (weight < 50) and does not have a cough symptom, return "Healthy".
 * - If the weight is negative or zero, return "Invalid weight".
 */
fun diagnosis(symptoms: List<String>, weight: Int): String {

    if (weight <= 0) {
        return "Invalid weight"
    }

    return when {
        weight >= 50 && "cough" in symptoms -> "Pneumonia"
        weight >= 50 && "cough" !in symptoms -> "Obesity"
        weight < 50 && "cough" in symptoms -> "Bronchitis"
        weight < 50 && "cough" !in symptoms -> "Healthy"
        else -> "Invalid weight"
    }
}
/**
 * A veterinarian is trying to diagnose the health condition of a pet based on its symptoms and weight.
 *
 * @param symptoms A list of symptoms exhibited by the pet.
 * @param weight The weight of the pet in pounds.
 * @return The diagnosis based on the given conditions:
 * - If the pet is heavy (weight >= 50) and has a cough symptom, return "Pneumonia".
 * - If the pet is heavy (weight >= 50) and does not have a cough symptom, return "Obesity".
 * - If the pet is light (weight < 50) and has a cough symptom, return "Bronchitis".
 * - If the pet is light (weight < 50) and does not have a cough symptom, return "Healthy".
 * - If the weight is negative or zero, return "Invalid weight".
 */
fun diagnosis(symptoms: List<String>, weight: Int): String {
/**
 * A veterinarian is trying to diagnose the health condition of a pet based on its symptoms and weight.
 *
 * @param symptoms A list of symptoms exhibited by the pet.
 * @param weight The weight of the pet in pounds.
 * @return The diagnosis based on the given conditions:
 * - If the pet is heavy (weight >= 50) and has a cough symptom, return "Pneumonia".
 * - If the pet is heavy (weight >= 50) and does not have a cough symptom, return "Obesity".
 * - If the pet is light (weight < 50) and has a cough symptom, return "Bronchitis".
 * - If the pet is light (weight < 50) and does not have a cough symptom, return "Healthy".
 * - If the weight is negative or zero, return "Invalid weight".
 */
fun diagnosis(symptoms: List<String>, weight: Int): String {

    if (weight <= 0) {
        return "Invalid weight"
    }

    return when {
        weight >= 50 && "cough" in symptoms -> "Pneumonia"
        weight >= 50 && "cough" !in symptoms -> "Obesity"
        weight < 50 && "cough" in symptoms -> "Bronchitis"
        weight < 50 && "cough" !in symptoms -> "Healthy"
        else -> "Invalid weight"
    }
}