/**
 * Given a list of animals, find the healthy animals.
 * An animal is considered healthy if its weight is greater than 50 and
 * it does not have any chronic illness.
 *
 * @param animals A list of maps representing the animals.
 * Each map contains 'name', 'weight', and 'chronicIllness'.
 *
 * @return A list of names of healthy animals.
 */
fun findHealthyAnimals(animals: List<Map<String, Any>>): List<String> {

    val healthyAnimals = mutableListOf<String>()

    for (animal in animals) {
        // Complete the loop condition
        if (animal["weight"] as Int > 50) {
            // Check if the animal is healthy
            if (animal["chronicIllness"] as Boolean == false) {
                // Add the name of healthy animals to the list
                healthyAnimals.add(animal["name"] as String)
            }
        }
    }

    return healthyAnimals
}
/**
 * Given a list of animals, find the healthy animals.
 * An animal is considered healthy if its weight is greater than 50 and
 * it does not have any chronic illness.
 *
 * @param animals A list of maps representing the animals.
 * Each map contains 'name', 'weight', and 'chronicIllness'.
 *
 * @return A list of names of healthy animals.
 */
fun findHealthyAnimals(animals: List<Map<String, Any>>): List<String> {
/**
 * Given a list of animals, find the healthy animals.
 * An animal is considered healthy if its weight is greater than 50 and
 * it does not have any chronic illness.
 *
 * @param animals A list of maps representing the animals.
 * Each map contains 'name', 'weight', and 'chronicIllness'.
 *
 * @return A list of names of healthy animals.
 */
fun findHealthyAnimals(animals: List<Map<String, Any>>): List<String> {

    val healthyAnimals = mutableListOf<String>()

    for (animal in animals) {
        // Complete the loop condition
        if (animal["weight"] as Int > 50) {
            // Check if the animal is healthy
            if (animal["chronicIllness"] as Boolean == false) {
                // Add the name of healthy animals to the list
                healthyAnimals.add(animal["name"] as String)
            }
        }
    }

    return healthyAnimals
}