/**
 * This function appends elements from list2 into list1 and removes common elements between them.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return The modified list1 after appending and removal operations
 */
fun appendRemoveComparison(list1: MutableList<Any>, list2: List<Any>): MutableList<Any> {

    for (element in list2) {
        // Append element if it is not already present in list1
        if (element !in list1) {
            list1.add(element)
        } else if (element in list1) {
            list1.remove(element)
        }
    }
    return list1
}
/**
 * This function appends elements from list2 into list1 and removes common elements between them.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return The modified list1 after appending and removal operations
 */
fun appendRemoveComparison(list1: MutableList<Any>, list2: List<Any>): MutableList<Any> {
/**
 * This function appends elements from list2 into list1 and removes common elements between them.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return The modified list1 after appending and removal operations
 */
fun appendRemoveComparison(list1: MutableList<Any>, list2: List<Any>): MutableList<Any> {

    for (element in list2) {
        // Append element if it is not already present in list1
        if (element !in list1) {
            list1.add(element)
        } else if (element in list1) {
            list1.remove(element)
        }
    }
    return list1
}