/**
 * A zoologist needs your help to find all the endangered species in the zoo.
 * You are given a map 'zoo' where the keys represent different animal species
 * and the values represent their conservation status. Your task is to loop through
 * the map and identify all the endangered species.
 *
 * @param zoo A map containing animal species as keys and their conservation status as values.
 * @return A list containing all the endangered species in the zoo.
 */
fun findEndangeredSpecies(zoo: Map<String, String>): List<String> {

    // Initialize an empty list to store the endangered species
    val endangeredSpecies = mutableListOf<String>()

    // Loop through each animal species and conservation status in the zoo map
    for ((species, status) in zoo) {
        // Check if the conservation status is 'endangered'
        if (status == "endangered") {
            // Add the endangered species to the list
            endangeredSpecies.add(species)
        }
    }

    return endangeredSpecies
}
/**
 * A zoologist needs your help to find all the endangered species in the zoo.
 * You are given a map 'zoo' where the keys represent different animal species
 * and the values represent their conservation status. Your task is to loop through
 * the map and identify all the endangered species.
 *
 * @param zoo A map containing animal species as keys and their conservation status as values.
 * @return A list containing all the endangered species in the zoo.
 */
fun findEndangeredSpecies(zoo: Map<String, String>): List<String> {
/**
 * A zoologist needs your help to find all the endangered species in the zoo.
 * You are given a map 'zoo' where the keys represent different animal species
 * and the values represent their conservation status. Your task is to loop through
 * the map and identify all the endangered species.
 *
 * @param zoo A map containing animal species as keys and their conservation status as values.
 * @return A list containing all the endangered species in the zoo.
 */
fun findEndangeredSpecies(zoo: Map<String, String>): List<String> {

    // Initialize an empty list to store the endangered species
    val endangeredSpecies = mutableListOf<String>()

    // Loop through each animal species and conservation status in the zoo map
    for ((species, status) in zoo) {
        // Check if the conservation status is 'endangered'
        if (status == "endangered") {
            // Add the endangered species to the list
            endangeredSpecies.add(species)
        }
    }

    return endangeredSpecies
}