/**
 * A zoologist needs to count the number of animals in a zoo. However, due to floating-point errors,
 * the count may not be precise. The zoologist wants to implement a function that checks if the count
 * is within a given epsilon tolerance of the target count. Your task is to complete the function to
 * count the animals and determine if the count is within the given epsilon.
 *
 * @param zoo A list of integers representing the number of animals in each cage.
 * @param targetCount The target count of animals in the zoo.
 * @param epsilon The tolerance value for floating-point errors.
 * @return True if the count is within the epsilon tolerance of the target count, otherwise False.
 */
fun countAnimals(zoo: List<Int>, targetCount: Int, epsilon: Double): Boolean {

    var count = 0

    for (cage in zoo) {
        count += cage
    }

    return Math.abs(count - targetCount) <= epsilon
}
/**
 * A zoologist needs to count the number of animals in a zoo. However, due to floating-point errors,
 * the count may not be precise. The zoologist wants to implement a function that checks if the count
 * is within a given epsilon tolerance of the target count. Your task is to complete the function to
 * count the animals and determine if the count is within the given epsilon.
 *
 * @param zoo A list of integers representing the number of animals in each cage.
 * @param targetCount The target count of animals in the zoo.
 * @param epsilon The tolerance value for floating-point errors.
 * @return True if the count is within the epsilon tolerance of the target count, otherwise False.
 */
fun countAnimals(zoo: List<Int>, targetCount: Int, epsilon: Double): Boolean {
/**
 * A zoologist needs to count the number of animals in a zoo. However, due to floating-point errors,
 * the count may not be precise. The zoologist wants to implement a function that checks if the count
 * is within a given epsilon tolerance of the target count. Your task is to complete the function to
 * count the animals and determine if the count is within the given epsilon.
 *
 * @param zoo A list of integers representing the number of animals in each cage.
 * @param targetCount The target count of animals in the zoo.
 * @param epsilon The tolerance value for floating-point errors.
 * @return True if the count is within the epsilon tolerance of the target count, otherwise False.
 */
fun countAnimals(zoo: List<Int>, targetCount: Int, epsilon: Double): Boolean {

    var count = 0

    for (cage in zoo) {
        count += cage
    }

    return Math.abs(count - targetCount) <= epsilon
}