/**
 * Astronomer wants to calculate the number of visible planets.
 *
 * Given a list of planets, count the number of visible planets by checking if the distance from each planet to the sun is greater than a certain value,
 * which is given as a parameter to the function.
 *
 * @param num_of_planets The total number of planets.
 * @param planets A list of maps representing the planets. Each map contains the planet name and its distance from the sun.
 * @return The number of visible planets.
 */
fun calculateVisiblePlanets(numOfPlanets: Int, planets: List<Map<String, Int>>): Int {

    var visiblePlanets = 0
    val distanceThreshold = 1000
    for (i in 0 until numOfPlanets) {
        val planet = planets[i]

        // Determine if the planet is visible based on its distance from the sun
        if (planet["distance"]!! > distanceThreshold) {
            visiblePlanets++
        }
    }
    return visiblePlanets
}
/**
 * Astronomer wants to calculate the number of visible planets.
 *
 * Given a list of planets, count the number of visible planets by checking if the distance from each planet to the sun is greater than a certain value,
 * which is given as a parameter to the function.
 *
 * @param num_of_planets The total number of planets.
 * @param planets A list of maps representing the planets. Each map contains the planet name and its distance from the sun.
 * @return The number of visible planets.
 */
fun calculateVisiblePlanets(numOfPlanets: Int, planets: List<Map<String, Int>>): Int {
/**
 * Astronomer wants to calculate the number of visible planets.
 *
 * Given a list of planets, count the number of visible planets by checking if the distance from each planet to the sun is greater than a certain value,
 * which is given as a parameter to the function.
 *
 * @param num_of_planets The total number of planets.
 * @param planets A list of maps representing the planets. Each map contains the planet name and its distance from the sun.
 * @return The number of visible planets.
 */
fun calculateVisiblePlanets(numOfPlanets: Int, planets: List<Map<String, Int>>): Int {

    var visiblePlanets = 0
    val distanceThreshold = 1000
    for (i in 0 until numOfPlanets) {
        val planet = planets[i]

        // Determine if the planet is visible based on its distance from the sun
        if (planet["distance"]!! > distanceThreshold) {
            visiblePlanets++
        }
    }
    return visiblePlanets
}