/**
 * Given two lists of animal names in two different zoos, find the common animals between them.
 *
 * @param zoo1 The first list of animal names
 * @param zoo2 The second list of animal names
 * @return A list of common animals between zoo1 and zoo2
 */
fun findCommonAnimals(zoo1: List<String>, zoo2: List<String>): List<String> {

    // Create an empty list to store common animals
    val commonAnimals = mutableListOf<String>()

    // Iterate over each animal in zoo1
    for (animal in zoo1) {
        // Check if the animal is also present in zoo2
        if (animal in zoo2) {
            // Check if the animal is not already in the commonAnimals list
            if (animal !in commonAnimals) {
                // Append the animal to the commonAnimals list
                commonAnimals.add(animal)
            }
        }
    }

    // Return the list of common animals
    return commonAnimals
}
/**
 * Given two lists of animal names in two different zoos, find the common animals between them.
 *
 * @param zoo1 The first list of animal names
 * @param zoo2 The second list of animal names
 * @return A list of common animals between zoo1 and zoo2
 */
fun findCommonAnimals(zoo1: List<String>, zoo2: List<String>): List<String> {
/**
 * Given two lists of animal names in two different zoos, find the common animals between them.
 *
 * @param zoo1 The first list of animal names
 * @param zoo2 The second list of animal names
 * @return A list of common animals between zoo1 and zoo2
 */
fun findCommonAnimals(zoo1: List<String>, zoo2: List<String>): List<String> {

    // Create an empty list to store common animals
    val commonAnimals = mutableListOf<String>()

    // Iterate over each animal in zoo1
    for (animal in zoo1) {
        // Check if the animal is also present in zoo2
        if (animal in zoo2) {
            // Check if the animal is not already in the commonAnimals list
            if (animal !in commonAnimals) {
                // Append the animal to the commonAnimals list
                commonAnimals.add(animal)
            }
        }
    }

    // Return the list of common animals
    return commonAnimals
}