/**
 * Given a list of veterinary records, this function returns a list of animals that are considered healthy.
 *
 * Each veterinary record is represented as a dictionary with 'animal_name' and 'health_status' keys,
 * where 'animal_name' is a string and 'health_status' is boolean (True if healthy, False otherwise).
 *
 * For example:
 * vetRecords = listOf(
 *     mapOf("animal_name" to "Fluffy", "health_status" to true),
 *     mapOf("animal_name" to "Spot", "health_status" to false),
 *     mapOf("animal_name" to "Buddy", "health_status" to true)
 * )
 *
 * findHealthyAnimals(vetRecords) should return ['Fluffy', 'Buddy']
 */
fun findHealthyAnimals(vetRecords: List<Map<String, Any>>): List<String> {

    val healthyAnimals = mutableListOf<String>()
    for (record in vetRecords) {
        val animalName = record["animal_name"] as String
        val healthStatus = record["health_status"] as Boolean
        if (healthStatus) {  // checking if the animal is healthy
            healthyAnimals.add(animalName)
        }
    }
    return healthyAnimals
}
/**
 * Given a list of veterinary records, this function returns a list of animals that are considered healthy.
 *
 * Each veterinary record is represented as a dictionary with 'animal_name' and 'health_status' keys,
 * where 'animal_name' is a string and 'health_status' is boolean (True if healthy, False otherwise).
 *
 * For example:
 * vetRecords = listOf(
 *     mapOf("animal_name" to "Fluffy", "health_status" to true),
 *     mapOf("animal_name" to "Spot", "health_status" to false),
 *     mapOf("animal_name" to "Buddy", "health_status" to true)
 * )
 *
 * findHealthyAnimals(vetRecords) should return ['Fluffy', 'Buddy']
 */
fun findHealthyAnimals(vetRecords: List<Map<String, Any>>): List<String> {
/**
 * Given a list of veterinary records, this function returns a list of animals that are considered healthy.
 *
 * Each veterinary record is represented as a dictionary with 'animal_name' and 'health_status' keys,
 * where 'animal_name' is a string and 'health_status' is boolean (True if healthy, False otherwise).
 *
 * For example:
 * vetRecords = listOf(
 *     mapOf("animal_name" to "Fluffy", "health_status" to true),
 *     mapOf("animal_name" to "Spot", "health_status" to false),
 *     mapOf("animal_name" to "Buddy", "health_status" to true)
 * )
 *
 * findHealthyAnimals(vetRecords) should return ['Fluffy', 'Buddy']
 */
fun findHealthyAnimals(vetRecords: List<Map<String, Any>>): List<String> {

    val healthyAnimals = mutableListOf<String>()
    for (record in vetRecords) {
        val animalName = record["animal_name"] as String
        val healthStatus = record["health_status"] as Boolean
        if (healthStatus) {  // checking if the animal is healthy
            healthyAnimals.add(animalName)
        }
    }
    return healthyAnimals
}