/**
 * This exercise requires you to find the common elements between two lists of stars using list comprehension and repetition.
 *
 * Given two lists of stars, stars1 and stars2, write a function that returns a list containing the stars that are present in both lists.
 *
 * @param stars1 List of stars (strings)
 * @param stars2 List of stars (strings)
 * @return List of stars (strings) present in both stars1 and stars2
 *
 * Example:
 * stars1 = ["Sun", "Proxima Centauri", "Alpha Centauri", "Barnard's Star", "Sirius"]
 * stars2 = ["Proxima Centauri", "Sirius", "Vega", "Polaris"]
 * findCommonElements(stars1, stars2) // Output: ['Proxima Centauri', 'Sirius']
 */
fun findCommonElements(stars1: List<String>, stars2: List<String>): List<String> {

    return stars1.filter { star -> stars2.contains(star) }
}
/**
 * This exercise requires you to find the common elements between two lists of stars using list comprehension and repetition.
 *
 * Given two lists of stars, stars1 and stars2, write a function that returns a list containing the stars that are present in both lists.
 *
 * @param stars1 List of stars (strings)
 * @param stars2 List of stars (strings)
 * @return List of stars (strings) present in both stars1 and stars2
 *
 * Example:
 * stars1 = ["Sun", "Proxima Centauri", "Alpha Centauri", "Barnard's Star", "Sirius"]
 * stars2 = ["Proxima Centauri", "Sirius", "Vega", "Polaris"]
 * findCommonElements(stars1, stars2) // Output: ['Proxima Centauri', 'Sirius']
 */
fun findCommonElements(stars1: List<String>, stars2: List<String>): List<String> {
/**
 * This exercise requires you to find the common elements between two lists of stars using list comprehension and repetition.
 *
 * Given two lists of stars, stars1 and stars2, write a function that returns a list containing the stars that are present in both lists.
 *
 * @param stars1 List of stars (strings)
 * @param stars2 List of stars (strings)
 * @return List of stars (strings) present in both stars1 and stars2
 *
 * Example:
 * stars1 = ["Sun", "Proxima Centauri", "Alpha Centauri", "Barnard's Star", "Sirius"]
 * stars2 = ["Proxima Centauri", "Sirius", "Vega", "Polaris"]
 * findCommonElements(stars1, stars2) // Output: ['Proxima Centauri', 'Sirius']
 */
fun findCommonElements(stars1: List<String>, stars2: List<String>): List<String> {

    return stars1.filter { star -> stars2.contains(star) }
}