/**
 * A veterinarian needs a diagnosis for different types of pets.
 *
 * Complete the code to provide diagnosis for different nested pairs representing pets.
 *
 * @param pet A nested pair representation of a pet, where the first element is the pet type and the second element is a pair representation of its symptoms.
 * @return A diagnosis based on the pet's symptoms.
 */
fun veterinarianDiagnosis(pet: Pair<String, Pair<List<String>, List<String>>>): String {

    val petType = pet.first
    val symptoms = pet.second.second

    return when (petType) {
        "dog" -> {
            when {
                "coughing" in symptoms -> {
                    when {
                        "fever" in symptoms -> {
                            when {
                                "vomiting" in symptoms -> "Your dog might have kennel cough."
                                "lethargy" in symptoms -> "Your dog might have a respiratory infection."
                                else -> "Your dog might have a cold."
                            }
                        }
                        "vomiting blood" in symptoms -> "Your dog might have parvovirus."
                        else -> "Your dog might have a gastrointestinal issue."
                    }
                }
                "lethargy" in symptoms -> {
                    if ("lameness" in symptoms) {
                        "Your dog might have a musculoskeletal issue."
                    } else {
                        "Your dog might have a general health problem."
                    }
                }
                else -> "Your dog's symptoms are inconclusive."
            }
        }
        else -> "Diagnosis not available for this pet type."
    }
}
/**
 * A veterinarian needs a diagnosis for different types of pets.
 *
 * Complete the code to provide diagnosis for different nested pairs representing pets.
 *
 * @param pet A nested pair representation of a pet, where the first element is the pet type and the second element is a pair representation of its symptoms.
 * @return A diagnosis based on the pet's symptoms.
 */
fun veterinarianDiagnosis(pet: Pair<String, Pair<List<String>, List<String>>>): String {
/**
 * A veterinarian needs a diagnosis for different types of pets.
 *
 * Complete the code to provide diagnosis for different nested pairs representing pets.
 *
 * @param pet A nested pair representation of a pet, where the first element is the pet type and the second element is a pair representation of its symptoms.
 * @return A diagnosis based on the pet's symptoms.
 */
fun veterinarianDiagnosis(pet: Pair<String, Pair<List<String>, List<String>>>): String {

    val petType = pet.first
    val symptoms = pet.second.second

    return when (petType) {
        "dog" -> {
            when {
                "coughing" in symptoms -> {
                    when {
                        "fever" in symptoms -> {
                            when {
                                "vomiting" in symptoms -> "Your dog might have kennel cough."
                                "lethargy" in symptoms -> "Your dog might have a respiratory infection."
                                else -> "Your dog might have a cold."
                            }
                        }
                        "vomiting blood" in symptoms -> "Your dog might have parvovirus."
                        else -> "Your dog might have a gastrointestinal issue."
                    }
                }
                "lethargy" in symptoms -> {
                    if ("lameness" in symptoms) {
                        "Your dog might have a musculoskeletal issue."
                    } else {
                        "Your dog might have a general health problem."
                    }
                }
                else -> "Your dog's symptoms are inconclusive."
            }
        }
        else -> "Diagnosis not available for this pet type."
    }
}