/**
 * Given two sets of planets, find the intersection using nested loops and the AND operator.
 *
 * @param planetSet1 The first set of planets.
 * @param planetSet2 The second set of planets.
 * @return The intersection of the two sets of planets.
 *
 * Example:
 * findIntersectionOfPlanetsAstronomer(setOf("Earth", "Mars", "Venus"), setOf("Mars", "Jupiter", "Saturn")) // Output: setOf("Mars")
 * findIntersectionOfPlanetsAstronomer(setOf("Mars", "Jupiter"), setOf("Venus", "Saturn", "Neptune")) // Output: emptySet()
 */
fun findIntersectionOfPlanetsAstronomer(planetSet1: Set<String>, planetSet2: Set<String>): Set<String> {

    val intersection = mutableSetOf<String>()

    // Iterate over each planet in the first set
    for (planet1 in planetSet1) {
        // Iterate over each planet in the second set
        for (planet2 in planetSet2) {
            // If a planet exists in both sets, add it to the intersection set
            if (planet1 == planet2) {
                intersection.add(planet1)
            }
        }
    }

    return intersection
}
/**
 * Given two sets of planets, find the intersection using nested loops and the AND operator.
 *
 * @param planetSet1 The first set of planets.
 * @param planetSet2 The second set of planets.
 * @return The intersection of the two sets of planets.
 *
 * Example:
 * findIntersectionOfPlanetsAstronomer(setOf("Earth", "Mars", "Venus"), setOf("Mars", "Jupiter", "Saturn")) // Output: setOf("Mars")
 * findIntersectionOfPlanetsAstronomer(setOf("Mars", "Jupiter"), setOf("Venus", "Saturn", "Neptune")) // Output: emptySet()
 */
fun findIntersectionOfPlanetsAstronomer(planetSet1: Set<String>, planetSet2: Set<String>): Set<String> {
/**
 * Given two sets of planets, find the intersection using nested loops and the AND operator.
 *
 * @param planetSet1 The first set of planets.
 * @param planetSet2 The second set of planets.
 * @return The intersection of the two sets of planets.
 *
 * Example:
 * findIntersectionOfPlanetsAstronomer(setOf("Earth", "Mars", "Venus"), setOf("Mars", "Jupiter", "Saturn")) // Output: setOf("Mars")
 * findIntersectionOfPlanetsAstronomer(setOf("Mars", "Jupiter"), setOf("Venus", "Saturn", "Neptune")) // Output: emptySet()
 */
fun findIntersectionOfPlanetsAstronomer(planetSet1: Set<String>, planetSet2: Set<String>): Set<String> {

    val intersection = mutableSetOf<String>()

    // Iterate over each planet in the first set
    for (planet1 in planetSet1) {
        // Iterate over each planet in the second set
        for (planet2 in planetSet2) {
            // If a planet exists in both sets, add it to the intersection set
            if (planet1 == planet2) {
                intersection.add(planet1)
            }
        }
    }

    return intersection
}