/**
 * This function takes two lists - list1 and list2. It appends elements from list1 into list2, and
 * then removes duplicate elements from list2. Finally, it returns the modified list2.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return The modified list2 after appending elements from list1 and removing duplicates
 */
fun appendRemoveElements(list1: List<Any>, list2: MutableList<Any>): List<Any> {

    // Append elements from list1 into list2
    list2.addAll(list1)

    // Remove duplicate elements from list2
    list2.toSet().let {
        list2.clear()
        list2.addAll(it)
    }

    return list2
}
/**
 * This function takes two lists - list1 and list2. It appends elements from list1 into list2, and
 * then removes duplicate elements from list2. Finally, it returns the modified list2.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return The modified list2 after appending elements from list1 and removing duplicates
 */
fun appendRemoveElements(list1: List<Any>, list2: MutableList<Any>): List<Any> {
/**
 * This function takes two lists - list1 and list2. It appends elements from list1 into list2, and
 * then removes duplicate elements from list2. Finally, it returns the modified list2.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return The modified list2 after appending elements from list1 and removing duplicates
 */
fun appendRemoveElements(list1: List<Any>, list2: MutableList<Any>): List<Any> {

    // Append elements from list1 into list2
    list2.addAll(list1)

    // Remove duplicate elements from list2
    list2.toSet().let {
        list2.clear()
        list2.addAll(it)
    }

    return list2
}