/**
 * Given a list of star systems, extract all the galaxies present in the universe.
 *
 * @param starSystems a list of star systems, each represented as a map with the following keys:
 * - "name": a string representing the name of the star system
 * - "galaxy": a string representing the name of the galaxy the star system belongs to
 * @return a list of unique galaxy names present in the universe
 */
fun extractGalaxies(starSystems: List<Map<String, String>>): List<String> {

    val galaxies = starSystems.filter { it["galaxy"] != null }.map { it["galaxy"]!! }
    return galaxies.toSet().toList()
}
/**
 * Given a list of star systems, extract all the galaxies present in the universe.
 *
 * @param starSystems a list of star systems, each represented as a map with the following keys:
 * - "name": a string representing the name of the star system
 * - "galaxy": a string representing the name of the galaxy the star system belongs to
 * @return a list of unique galaxy names present in the universe
 */
fun extractGalaxies(starSystems: List<Map<String, String>>): List<String> {
/**
 * Given a list of star systems, extract all the galaxies present in the universe.
 *
 * @param starSystems a list of star systems, each represented as a map with the following keys:
 * - "name": a string representing the name of the star system
 * - "galaxy": a string representing the name of the galaxy the star system belongs to
 * @return a list of unique galaxy names present in the universe
 */
fun extractGalaxies(starSystems: List<Map<String, String>>): List<String> {

    val galaxies = starSystems.filter { it["galaxy"] != null }.map { it["galaxy"]!! }
    return galaxies.toSet().toList()
}