/**
 * Given a list of species with their population count and a threshold,
 * return the list of species whose population count is less than the threshold.
 *
 * @param speciesList A list of pairs where each pair contains the name of a species and its population count.
 * @param threshold The threshold population count.
 * @return A list of species names whose population count is less than the threshold.
 */
fun findSpeciesLessThanThreshold(speciesList: List<Pair<String, Int>>, threshold: Int): List<String> {

    // Initialize an empty list to store the species names
    val speciesLessThanThreshold = mutableListOf<String>()

    // Iterate over each species in the speciesList
    for ((species, population) in speciesList) {
        // Check if the population count is less than the threshold
        if (population < threshold) {
            // Append the species name to the result list
            speciesLessThanThreshold.add(species)
        }
    }

    // Return the list of species names whose population count is less than the threshold
    return speciesLessThanThreshold
}
/**
 * Given a list of species with their population count and a threshold,
 * return the list of species whose population count is less than the threshold.
 *
 * @param speciesList A list of pairs where each pair contains the name of a species and its population count.
 * @param threshold The threshold population count.
 * @return A list of species names whose population count is less than the threshold.
 */
fun findSpeciesLessThanThreshold(speciesList: List<Pair<String, Int>>, threshold: Int): List<String> {
/**
 * Given a list of species with their population count and a threshold,
 * return the list of species whose population count is less than the threshold.
 *
 * @param speciesList A list of pairs where each pair contains the name of a species and its population count.
 * @param threshold The threshold population count.
 * @return A list of species names whose population count is less than the threshold.
 */
fun findSpeciesLessThanThreshold(speciesList: List<Pair<String, Int>>, threshold: Int): List<String> {

    // Initialize an empty list to store the species names
    val speciesLessThanThreshold = mutableListOf<String>()

    // Iterate over each species in the speciesList
    for ((species, population) in speciesList) {
        // Check if the population count is less than the threshold
        if (population < threshold) {
            // Append the species name to the result list
            speciesLessThanThreshold.add(species)
        }
    }

    // Return the list of species names whose population count is less than the threshold
    return speciesLessThanThreshold
}