/**
 * Given a list of elements and a list of new elements, append the new elements to the end of the list.
 * If an element in the new elements list already exists in the original elements list, skip it and continue to the next one.
 *
 * @param elements The original list of elements.
 * @param newElements The list of new elements to be appended.
 * @return The updated list of elements after appending the new elements.
 */
fun appendNewElements(elements: MutableList<Any>, newElements: List<Any>): List<Any> {

    for (newElement in newElements) {
        if (newElement in elements) {
            continue
        }
        elements.add(newElement)
    }
    
    return elements
}
/**
 * Given a list of elements and a list of new elements, append the new elements to the end of the list.
 * If an element in the new elements list already exists in the original elements list, skip it and continue to the next one.
 *
 * @param elements The original list of elements.
 * @param newElements The list of new elements to be appended.
 * @return The updated list of elements after appending the new elements.
 */
fun appendNewElements(elements: MutableList<Any>, newElements: List<Any>): List<Any> {
/**
 * Given a list of elements and a list of new elements, append the new elements to the end of the list.
 * If an element in the new elements list already exists in the original elements list, skip it and continue to the next one.
 *
 * @param elements The original list of elements.
 * @param newElements The list of new elements to be appended.
 * @return The updated list of elements after appending the new elements.
 */
fun appendNewElements(elements: MutableList<Any>, newElements: List<Any>): List<Any> {

    for (newElement in newElements) {
        if (newElement in elements) {
            continue
        }
        elements.add(newElement)
    }
    
    return elements
}