/**
 * Given a list of sightings, find the species that satisfy all the given conditions:
 * 1. The sighting should be from a mammal.
 * 2. The sighting should be from a carnivore or omnivore.
 * 3. The sighting should be from a nocturnal animal.
 *
 * @param sightings A list of maps representing sightings, where each map contains information about a species.
 * @return A list of strings representing the species that meet all the conditions.
 */
fun findSpecies(sightings: List<Map<String, Any>>): List<String> {

    return sightings.filter { sighting ->
        sighting["class"] == "Mammal" && (sighting["diet"] == "Carnivore" || sighting["diet"] == "Omnivore") && sighting["nocturnal"] as Boolean
    }.map { it["species"] as String }
}
/**
 * Given a list of sightings, find the species that satisfy all the given conditions:
 * 1. The sighting should be from a mammal.
 * 2. The sighting should be from a carnivore or omnivore.
 * 3. The sighting should be from a nocturnal animal.
 *
 * @param sightings A list of maps representing sightings, where each map contains information about a species.
 * @return A list of strings representing the species that meet all the conditions.
 */
fun findSpecies(sightings: List<Map<String, Any>>): List<String> {
/**
 * Given a list of sightings, find the species that satisfy all the given conditions:
 * 1. The sighting should be from a mammal.
 * 2. The sighting should be from a carnivore or omnivore.
 * 3. The sighting should be from a nocturnal animal.
 *
 * @param sightings A list of maps representing sightings, where each map contains information about a species.
 * @return A list of strings representing the species that meet all the conditions.
 */
fun findSpecies(sightings: List<Map<String, Any>>): List<String> {

    return sightings.filter { sighting ->
        sighting["class"] == "Mammal" && (sighting["diet"] == "Carnivore" || sighting["diet"] == "Omnivore") && sighting["nocturnal"] as Boolean
    }.map { it["species"] as String }
}