/**
 * Determine if any pets exhibit similar symptoms in a veterinarian's clinic.
 *
 * Given a list of pets, consisting of nested lists where each inner list represents a pet,
 * each inner list contains the pet's name followed by its symptoms. Your task is to identify
 * if any two pets have the same symptoms.
 *
 * @param pets A list of pets and their symptoms.
 * @return True if any two pets have the same symptoms, False otherwise.
 */
fun checkSymptoms(pets: List<List<String>>): Boolean {

    // Nested loops to iterate over each pet in the list
    for (i in pets.indices) {
        for (j in i + 1 until pets.size) {
            // Check if the symptoms of two pets match
            if (pets[i].subList(1, pets[i].size) == pets[j].subList(1, pets[j].size)) {
                return true  // Similar symptoms found
            }
        }
    }
    return false  // No similar symptoms found
}
/**
 * Determine if any pets exhibit similar symptoms in a veterinarian's clinic.
 *
 * Given a list of pets, consisting of nested lists where each inner list represents a pet,
 * each inner list contains the pet's name followed by its symptoms. Your task is to identify
 * if any two pets have the same symptoms.
 *
 * @param pets A list of pets and their symptoms.
 * @return True if any two pets have the same symptoms, False otherwise.
 */
fun checkSymptoms(pets: List<List<String>>): Boolean {
/**
 * Determine if any pets exhibit similar symptoms in a veterinarian's clinic.
 *
 * Given a list of pets, consisting of nested lists where each inner list represents a pet,
 * each inner list contains the pet's name followed by its symptoms. Your task is to identify
 * if any two pets have the same symptoms.
 *
 * @param pets A list of pets and their symptoms.
 * @return True if any two pets have the same symptoms, False otherwise.
 */
fun checkSymptoms(pets: List<List<String>>): Boolean {

    // Nested loops to iterate over each pet in the list
    for (i in pets.indices) {
        for (j in i + 1 until pets.size) {
            // Check if the symptoms of two pets match
            if (pets[i].subList(1, pets[i].size) == pets[j].subList(1, pets[j].size)) {
                return true  // Similar symptoms found
            }
        }
    }
    return false  // No similar symptoms found
}