/**
 * Counts the number of occurrences of a specific animal in a given list of animals, greater than or equal to a minimum count.
 *
 * @param animalList List of animals.
 * @param minCount Minimum count of animal occurrences.
 * @param targetAnimal Animal to be counted.
 * @return Number of occurrences of the target animal greater than or equal to the minimum count.
 *
 * Example:
 * countAnimals(listOf("lion", "tiger", "lion", "cheetah", "elephant", "lion"), 3, "lion") // Output: 3
 */
fun countAnimals(animalList: List<String>, minCount: Int, targetAnimal: String): Int {

    var count = 0

    for (animal in animalList) {
        if (animal == targetAnimal) {
            count++
            if (count >= minCount) {
                continue
            }
        }
    }

    return count
}
/**
 * Counts the number of occurrences of a specific animal in a given list of animals, greater than or equal to a minimum count.
 *
 * @param animalList List of animals.
 * @param minCount Minimum count of animal occurrences.
 * @param targetAnimal Animal to be counted.
 * @return Number of occurrences of the target animal greater than or equal to the minimum count.
 *
 * Example:
 * countAnimals(listOf("lion", "tiger", "lion", "cheetah", "elephant", "lion"), 3, "lion") // Output: 3
 */
fun countAnimals(animalList: List<String>, minCount: Int, targetAnimal: String): Int {
/**
 * Counts the number of occurrences of a specific animal in a given list of animals, greater than or equal to a minimum count.
 *
 * @param animalList List of animals.
 * @param minCount Minimum count of animal occurrences.
 * @param targetAnimal Animal to be counted.
 * @return Number of occurrences of the target animal greater than or equal to the minimum count.
 *
 * Example:
 * countAnimals(listOf("lion", "tiger", "lion", "cheetah", "elephant", "lion"), 3, "lion") // Output: 3
 */
fun countAnimals(animalList: List<String>, minCount: Int, targetAnimal: String): Int {

    var count = 0

    for (animal in animalList) {
        if (animal == targetAnimal) {
            count++
            if (count >= minCount) {
                continue
            }
        }
    }

    return count
}