/**
 * This function takes a map of geolocations and their elevations, and returns a list of locations
 * with elevation below a specified threshold.
 *
 * @param locations A map where keys are location names and values are their corresponding elevations.
 * @param threshold The maximum elevation value for filtering locations.
 * @return A list of locations whose elevations are below the given threshold.
 *
 * Example:
 * findLocationsBelowElevationThreshold(mapOf("Mount Everest" to 8848, "Machu Picchu" to 2430, "Death Valley" to -86), 1000)
 * Output: ["Death Valley"]
 */
fun findLocationsBelowElevationThreshold(locations: Map<String, Int>, threshold: Int): List<String> {

    val belowThreshold = mutableListOf<String>()

    locations.forEach { (location, elevation) ->
        if (elevation < threshold) {
            belowThreshold.add(location)
        }
    }

    return belowThreshold
}
/**
 * This function takes a map of geolocations and their elevations, and returns a list of locations
 * with elevation below a specified threshold.
 *
 * @param locations A map where keys are location names and values are their corresponding elevations.
 * @param threshold The maximum elevation value for filtering locations.
 * @return A list of locations whose elevations are below the given threshold.
 *
 * Example:
 * findLocationsBelowElevationThreshold(mapOf("Mount Everest" to 8848, "Machu Picchu" to 2430, "Death Valley" to -86), 1000)
 * Output: ["Death Valley"]
 */
fun findLocationsBelowElevationThreshold(locations: Map<String, Int>, threshold: Int): List<String> {
/**
 * This function takes a map of geolocations and their elevations, and returns a list of locations
 * with elevation below a specified threshold.
 *
 * @param locations A map where keys are location names and values are their corresponding elevations.
 * @param threshold The maximum elevation value for filtering locations.
 * @return A list of locations whose elevations are below the given threshold.
 *
 * Example:
 * findLocationsBelowElevationThreshold(mapOf("Mount Everest" to 8848, "Machu Picchu" to 2430, "Death Valley" to -86), 1000)
 * Output: ["Death Valley"]
 */
fun findLocationsBelowElevationThreshold(locations: Map<String, Int>, threshold: Int): List<String> {

    val belowThreshold = mutableListOf<String>()

    locations.forEach { (location, elevation) ->
        if (elevation < threshold) {
            belowThreshold.add(location)
        }
    }

    return belowThreshold
}