/**
 * This function counts the number of endangered species in a given list.
 * It skips over any non-endangered species using the continue statement.
 *
 * @param endangeredSpeciesList A list of species, where each element is a Pair.
 *                              Each Pair contains the species name as the first
 *                              element and a boolean value indicating whether it is
 *                              endangered (true) or not (false) as the second element.
 * @return The count of endangered species in the list.
 */
fun countSpecies(endangeredSpeciesList: List<Pair<String, Boolean>>): Int {

    var count = 0  // Initialize a variable to store the count of endangered species

    for (species in endangeredSpeciesList) {
        if (!species.second) {
            continue  // Skip non-endangered species and move to the next iteration
        }

        count++  // Increment the count for each endangered species found
    }

    return count
}
/**
 * This function counts the number of endangered species in a given list.
 * It skips over any non-endangered species using the continue statement.
 *
 * @param endangeredSpeciesList A list of species, where each element is a Pair.
 *                              Each Pair contains the species name as the first
 *                              element and a boolean value indicating whether it is
 *                              endangered (true) or not (false) as the second element.
 * @return The count of endangered species in the list.
 */
fun countSpecies(endangeredSpeciesList: List<Pair<String, Boolean>>): Int {
/**
 * This function counts the number of endangered species in a given list.
 * It skips over any non-endangered species using the continue statement.
 *
 * @param endangeredSpeciesList A list of species, where each element is a Pair.
 *                              Each Pair contains the species name as the first
 *                              element and a boolean value indicating whether it is
 *                              endangered (true) or not (false) as the second element.
 * @return The count of endangered species in the list.
 */
fun countSpecies(endangeredSpeciesList: List<Pair<String, Boolean>>): Int {

    var count = 0  // Initialize a variable to store the count of endangered species

    for (species in endangeredSpeciesList) {
        if (!species.second) {
            continue  // Skip non-endangered species and move to the next iteration
        }

        count++  // Increment the count for each endangered species found
    }

    return count
}