/**
 * Given a list of astronomical objects and a list of new elements, append each element from newElements to
 * astronomicalObjects only if it is not already present in the list. Return the updated astronomicalObjects list.
 *
 * Example:
 * astronomicalObjects = mutableListOf("sun", "moon", "star")
 * newElements = listOf("sun", "planet", "galaxy")
 *
 * @return Updated list of astronomical objects after appending new elements
 */
fun appendElements(astronomicalObjects: MutableList<String>, newElements: List<String>): MutableList<String> {

    for (element in newElements) {
        if (element !in astronomicalObjects) {
            astronomicalObjects.add(element)
        }
    }
    return astronomicalObjects
}
/**
 * Given a list of astronomical objects and a list of new elements, append each element from newElements to
 * astronomicalObjects only if it is not already present in the list. Return the updated astronomicalObjects list.
 *
 * Example:
 * astronomicalObjects = mutableListOf("sun", "moon", "star")
 * newElements = listOf("sun", "planet", "galaxy")
 *
 * @return Updated list of astronomical objects after appending new elements
 */
fun appendElements(astronomicalObjects: MutableList<String>, newElements: List<String>): MutableList<String> {
/**
 * Given a list of astronomical objects and a list of new elements, append each element from newElements to
 * astronomicalObjects only if it is not already present in the list. Return the updated astronomicalObjects list.
 *
 * Example:
 * astronomicalObjects = mutableListOf("sun", "moon", "star")
 * newElements = listOf("sun", "planet", "galaxy")
 *
 * @return Updated list of astronomical objects after appending new elements
 */
fun appendElements(astronomicalObjects: MutableList<String>, newElements: List<String>): MutableList<String> {

    for (element in newElements) {
        if (element !in astronomicalObjects) {
            astronomicalObjects.add(element)
        }
    }
    return astronomicalObjects
}