/**
 * Given the list of animals treated by two veterinarians,
 * find the common animals using the 'in' operator and return them.
 *
 * @param vet1 The list of animals treated by the first veterinarian.
 * @param vet2 The list of animals treated by the second veterinarian.
 * @return The list of animals common to both veterinarians.
 */
fun checkCommonAnimals(vet1: List<String>, vet2: List<String>): List<String> {

    val commonAnimals = mutableListOf<String>()

    // Iterate over each animal treated by the first veterinarian
    for (animal in vet1) {
        // Check if the animal is also treated by the second veterinarian
        if (animal in vet2) {
            // Add the animal to the list of common animals
            commonAnimals.add(animal)
        }
    }

    return commonAnimals
}
/**
 * Given the list of animals treated by two veterinarians,
 * find the common animals using the 'in' operator and return them.
 *
 * @param vet1 The list of animals treated by the first veterinarian.
 * @param vet2 The list of animals treated by the second veterinarian.
 * @return The list of animals common to both veterinarians.
 */
fun checkCommonAnimals(vet1: List<String>, vet2: List<String>): List<String> {
/**
 * Given the list of animals treated by two veterinarians,
 * find the common animals using the 'in' operator and return them.
 *
 * @param vet1 The list of animals treated by the first veterinarian.
 * @param vet2 The list of animals treated by the second veterinarian.
 * @return The list of animals common to both veterinarians.
 */
fun checkCommonAnimals(vet1: List<String>, vet2: List<String>): List<String> {

    val commonAnimals = mutableListOf<String>()

    // Iterate over each animal treated by the first veterinarian
    for (animal in vet1) {
        // Check if the animal is also treated by the second veterinarian
        if (animal in vet2) {
            // Add the animal to the list of common animals
            commonAnimals.add(animal)
        }
    }

    return commonAnimals
}