/**
 * Given a list of artists and a list of new elements,
 * append only the new elements that are greater than or equal to the last element in the artists list.
 *
 * @param artists A list of artists.
 * @param newElements A list of new elements to be appended.
 * @return The updated artists list.
 */
fun appendGreaterOrEqual(artists: MutableList<Int>, newElements: List<Int>): MutableList<Int> {

    if (artists.isEmpty()) {
        return artists
    }

    val lastElement = artists.last()  // Get the last element of the artists list

    for (element in newElements) {
        if (element >= lastElement) {  // Check if the element is greater than or equal to the last element
            artists.add(element)  // Append the element to the artists list
        }
    }

    return artists
}
/**
 * Given a list of artists and a list of new elements,
 * append only the new elements that are greater than or equal to the last element in the artists list.
 *
 * @param artists A list of artists.
 * @param newElements A list of new elements to be appended.
 * @return The updated artists list.
 */
fun appendGreaterOrEqual(artists: MutableList<Int>, newElements: List<Int>): MutableList<Int> {
/**
 * Given a list of artists and a list of new elements,
 * append only the new elements that are greater than or equal to the last element in the artists list.
 *
 * @param artists A list of artists.
 * @param newElements A list of new elements to be appended.
 * @return The updated artists list.
 */
fun appendGreaterOrEqual(artists: MutableList<Int>, newElements: List<Int>): MutableList<Int> {

    if (artists.isEmpty()) {
        return artists
    }

    val lastElement = artists.last()  // Get the last element of the artists list

    for (element in newElements) {
        if (element >= lastElement) {  // Check if the element is greater than or equal to the last element
            artists.add(element)  // Append the element to the artists list
        }
    }

    return artists
}