/**
 * Given a list of animals and a pattern, find all the animals that match the pattern.
 *
 * @param animals A list of animals.
 * @param pattern A pattern to match the animals.
 * @return A list of animals that match the pattern.
 */
fun findAnimals(animals: List<String>, pattern: String): List<String> {

    // Initialize an empty list to store matching animals
    val matchingAnimals = mutableListOf<String>()

    // Iterate over each animal in the list
    for (animal in animals) {
        // Check if the animal matches the pattern using equality comparison
        if (animal == pattern) {
            // If it matches, append it to the matching animals list
            matchingAnimals.add(animal)
        }
    }

    // Return the list of matching animals
    return matchingAnimals
}
/**
 * Given a list of animals and a pattern, find all the animals that match the pattern.
 *
 * @param animals A list of animals.
 * @param pattern A pattern to match the animals.
 * @return A list of animals that match the pattern.
 */
fun findAnimals(animals: List<String>, pattern: String): List<String> {
/**
 * Given a list of animals and a pattern, find all the animals that match the pattern.
 *
 * @param animals A list of animals.
 * @param pattern A pattern to match the animals.
 * @return A list of animals that match the pattern.
 */
fun findAnimals(animals: List<String>, pattern: String): List<String> {

    // Initialize an empty list to store matching animals
    val matchingAnimals = mutableListOf<String>()

    // Iterate over each animal in the list
    for (animal in animals) {
        // Check if the animal matches the pattern using equality comparison
        if (animal == pattern) {
            // If it matches, append it to the matching animals list
            matchingAnimals.add(animal)
        }
    }

    // Return the list of matching animals
    return matchingAnimals
}