/**
 * Given a list of planet names and the status of the telescope, return the names of the planets that are visible.
 *
 * @param planetNames A list of strings representing planet names.
 * @param telescopeStatus A boolean indicating the status of the telescope, true if it is functioning, false otherwise.
 * @return A list of strings representing the names of the planets that are visible.
 */
fun findVisiblePlanets(planetNames: List<String>, telescopeStatus: Boolean): List<String> {

    // If the telescope is not functioning, no planet is visible
    if (!telescopeStatus) {
        return emptyList()
    }

    // Create an empty list to store the visible planet names
    val visiblePlanets = mutableListOf<String>()

    // Iterate over each planet name in the given list
    for (planetName in planetNames) {
        // Use a function to check if the planet name is visible
        if (isPlanetVisible(planetName)) {
            visiblePlanets.add(planetName)
        }
    }

    return visiblePlanets
}

fun isPlanetVisible(planetName: String): Boolean {
    // Implement the logic to determine if a planet is visible
    return getVisiblePlanets().contains(planetName)
}

fun getVisiblePlanets(): List<String> {
    // Implement the logic to get the list of visible planets
    return listOf("Earth", "Mars", "Venus") // Example list of visible planets
}
/**
 * Given a list of planet names and the status of the telescope, return the names of the planets that are visible.
 *
 * @param planetNames A list of strings representing planet names.
 * @param telescopeStatus A boolean indicating the status of the telescope, true if it is functioning, false otherwise.
 * @return A list of strings representing the names of the planets that are visible.
 */
fun findVisiblePlanets(planetNames: List<String>, telescopeStatus: Boolean): List<String> {
/**
 * Given a list of planet names and the status of the telescope, return the names of the planets that are visible.
 *
 * @param planetNames A list of strings representing planet names.
 * @param telescopeStatus A boolean indicating the status of the telescope, true if it is functioning, false otherwise.
 * @return A list of strings representing the names of the planets that are visible.
 */
fun findVisiblePlanets(planetNames: List<String>, telescopeStatus: Boolean): List<String> {

    // If the telescope is not functioning, no planet is visible
    if (!telescopeStatus) {
        return emptyList()
    }

    // Create an empty list to store the visible planet names
    val visiblePlanets = mutableListOf<String>()

    // Iterate over each planet name in the given list
    for (planetName in planetNames) {
        // Use a function to check if the planet name is visible
        if (isPlanetVisible(planetName)) {
            visiblePlanets.add(planetName)
        }
    }

    return visiblePlanets
}

fun isPlanetVisible(planetName: String): Boolean {
    // Implement the logic to determine if a planet is visible
    return getVisiblePlanets().contains(planetName)
}

fun getVisiblePlanets(): List<String> {
    // Implement the logic to get the list of visible planets
    return listOf("Earth", "Mars", "Venus") // Example list of visible planets
}