/**
 * This function appends all the numbers from list2 to list1, excluding the numbers that are already in list1.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return The updated list1 after appending the numbers from list2.
 *
 * Example:
 * val list1 = mutableListOf(1, 2, 3)
 * val list2 = mutableListOf(3, 4, 5, 6)
 * appendNumbersNotEqual(list1, list2) // returns [1, 2, 3, 4, 5, 6]
 */
fun appendNumbersNotEqual(list1: MutableList<Int>, list2: MutableList<Int>): MutableList<Int> {

    for (num in list2) {
        if (num !in list1) {
            list1.add(num)
        }
    }
    return list1
}
/**
 * This function appends all the numbers from list2 to list1, excluding the numbers that are already in list1.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return The updated list1 after appending the numbers from list2.
 *
 * Example:
 * val list1 = mutableListOf(1, 2, 3)
 * val list2 = mutableListOf(3, 4, 5, 6)
 * appendNumbersNotEqual(list1, list2) // returns [1, 2, 3, 4, 5, 6]
 */
fun appendNumbersNotEqual(list1: MutableList<Int>, list2: MutableList<Int>): MutableList<Int> {
/**
 * This function appends all the numbers from list2 to list1, excluding the numbers that are already in list1.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return The updated list1 after appending the numbers from list2.
 *
 * Example:
 * val list1 = mutableListOf(1, 2, 3)
 * val list2 = mutableListOf(3, 4, 5, 6)
 * appendNumbersNotEqual(list1, list2) // returns [1, 2, 3, 4, 5, 6]
 */
fun appendNumbersNotEqual(list1: MutableList<Int>, list2: MutableList<Int>): MutableList<Int> {

    for (num in list2) {
        if (num !in list1) {
            list1.add(num)
        }
    }
    return list1
}