/**
 * This exercise focuses on copying items from one list to another using the 'is not' operator.
 *
 * @param list1 the source list containing items to be copied
 * @param list2 the destination list where items will be copied
 * @return the modified list2 with the copied items
 *
 * Note:
 * The 'is not' operator checks if two objects are not the same object in memory.
 * It is used here to avoid duplicating the same object references in list2.
 */
fun copyListItems(list1: List<Any>, list2: MutableList<Any>): MutableList<Any> {

    // Iterate over each item in list1
    for (item in list1) {
        // Check if the item is not already present in list2
        if (item !in list2) {
            // Append the item to list2
            list2.add(item)
        }
    }
    return list2
}
/**
 * This exercise focuses on copying items from one list to another using the 'is not' operator.
 *
 * @param list1 the source list containing items to be copied
 * @param list2 the destination list where items will be copied
 * @return the modified list2 with the copied items
 *
 * Note:
 * The 'is not' operator checks if two objects are not the same object in memory.
 * It is used here to avoid duplicating the same object references in list2.
 */
fun copyListItems(list1: List<Any>, list2: MutableList<Any>): MutableList<Any> {
/**
 * This exercise focuses on copying items from one list to another using the 'is not' operator.
 *
 * @param list1 the source list containing items to be copied
 * @param list2 the destination list where items will be copied
 * @return the modified list2 with the copied items
 *
 * Note:
 * The 'is not' operator checks if two objects are not the same object in memory.
 * It is used here to avoid duplicating the same object references in list2.
 */
fun copyListItems(list1: List<Any>, list2: MutableList<Any>): MutableList<Any> {

    // Iterate over each item in list1
    for (item in list1) {
        // Check if the item is not already present in list2
        if (item !in list2) {
            // Append the item to list2
            list2.add(item)
        }
    }
    return list2
}