/**
 * This function takes in a list of animals and classifies them based on their characteristics.
 * The animals are classified into three categories: Herbivores, Carnivores, and Omnivores.
 */
fun zoologistAnimalClassification(animals: List<String>): Triple<List<String>, List<String>, List<String>> {

    val herbivores = mutableListOf<String>()
    val carnivores = mutableListOf<String>()
    val omnivores = mutableListOf<String>()

    for (animal in animals) {
        val diet = if ("plants" in animal) "Herbivore" else if ("meat" in animal) "Carnivore" else "Omnivore"
        val habitat = if ("land" in animal) "Land" else if ("water" in animal) "Aquatic" else "Aerial"

        when {
            diet == "Herbivore" && habitat == "Land" -> herbivores.add(animal)
            diet == "Carnivore" && habitat == "Aquatic" -> carnivores.add(animal)
            else -> omnivores.add(animal)
        }
    }

    return Triple(herbivores, carnivores, omnivores)
}
/**
 * This function takes in a list of animals and classifies them based on their characteristics.
 * The animals are classified into three categories: Herbivores, Carnivores, and Omnivores.
 */
fun zoologistAnimalClassification(animals: List<String>): Triple<List<String>, List<String>, List<String>> {
/**
 * This function takes in a list of animals and classifies them based on their characteristics.
 * The animals are classified into three categories: Herbivores, Carnivores, and Omnivores.
 */
fun zoologistAnimalClassification(animals: List<String>): Triple<List<String>, List<String>, List<String>> {

    val herbivores = mutableListOf<String>()
    val carnivores = mutableListOf<String>()
    val omnivores = mutableListOf<String>()

    for (animal in animals) {
        val diet = if ("plants" in animal) "Herbivore" else if ("meat" in animal) "Carnivore" else "Omnivore"
        val habitat = if ("land" in animal) "Land" else if ("water" in animal) "Aquatic" else "Aerial"

        when {
            diet == "Herbivore" && habitat == "Land" -> herbivores.add(animal)
            diet == "Carnivore" && habitat == "Aquatic" -> carnivores.add(animal)
            else -> omnivores.add(animal)
        }
    }

    return Triple(herbivores, carnivores, omnivores)
}