/**
 * Given a list of stars with their names and magnitudes, return a list containing only the names of the stars that are
 * visible to the naked eye.
 *
 * @param magnitudeThreshold The maximum magnitude that a star should have in order to be visible.
 * @param stars The list of stars, where each star is represented by a Pair containing its name and magnitude.
 * @return A list of star names that are visible to the naked eye (magnitude lower than or equal to the threshold).
 */
fun getVisibleStars(magnitudeThreshold: Float, stars: List<Pair<String, Float>>): List<String> {

    // Using filter function to get the stars that have magnitude lower than or equal to the threshold
    return stars.filter { it.second <= magnitudeThreshold }.map { it.first }
}
/**
 * Given a list of stars with their names and magnitudes, return a list containing only the names of the stars that are
 * visible to the naked eye.
 *
 * @param magnitudeThreshold The maximum magnitude that a star should have in order to be visible.
 * @param stars The list of stars, where each star is represented by a Pair containing its name and magnitude.
 * @return A list of star names that are visible to the naked eye (magnitude lower than or equal to the threshold).
 */
fun getVisibleStars(magnitudeThreshold: Float, stars: List<Pair<String, Float>>): List<String> {
/**
 * Given a list of stars with their names and magnitudes, return a list containing only the names of the stars that are
 * visible to the naked eye.
 *
 * @param magnitudeThreshold The maximum magnitude that a star should have in order to be visible.
 * @param stars The list of stars, where each star is represented by a Pair containing its name and magnitude.
 * @return A list of star names that are visible to the naked eye (magnitude lower than or equal to the threshold).
 */
fun getVisibleStars(magnitudeThreshold: Float, stars: List<Pair<String, Float>>): List<String> {

    // Using filter function to get the stars that have magnitude lower than or equal to the threshold
    return stars.filter { it.second <= magnitudeThreshold }.map { it.first }
}