/**
 * Given a set of animals identified by a zoologist and a list of animals, find the common animals.
 *
 * @param zoologistSet A set of animals identified by a zoologist.
 * @param animalList A list of animals.
 * @return A list of common animals found both in the zoologist's set and the animal list.
 */
fun findCommonAnimals(zoologistSet: Set<String>, animalList: List<String>): List<String> {

    val commonAnimals = mutableListOf<String>()

    for (animal in zoologistSet) {
        for (item in animalList) {
            if (animal == item) {
                commonAnimals.add(animal)
            }
        }
    }

    return commonAnimals
}
/**
 * Given a set of animals identified by a zoologist and a list of animals, find the common animals.
 *
 * @param zoologistSet A set of animals identified by a zoologist.
 * @param animalList A list of animals.
 * @return A list of common animals found both in the zoologist's set and the animal list.
 */
fun findCommonAnimals(zoologistSet: Set<String>, animalList: List<String>): List<String> {
/**
 * Given a set of animals identified by a zoologist and a list of animals, find the common animals.
 *
 * @param zoologistSet A set of animals identified by a zoologist.
 * @param animalList A list of animals.
 * @return A list of common animals found both in the zoologist's set and the animal list.
 */
fun findCommonAnimals(zoologistSet: Set<String>, animalList: List<String>): List<String> {

    val commonAnimals = mutableListOf<String>()

    for (animal in zoologistSet) {
        for (item in animalList) {
            if (animal == item) {
                commonAnimals.add(animal)
            }
        }
    }

    return commonAnimals
}