/**
 * In this exercise, you need to remove duplicate entries from a set by copying lists.
 * The function takes two lists as input and should remove any duplicate entries present in the second list from the first list.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing duplicate entries to be removed.
 * @return Modified list1 after removing duplicate entries from list2.
 *
 * Example:
 * removeDuplicateEntries(listOf(1, 2, 3, 4, 5, 6, 7), listOf(2, 4, 6))
 * Expected output: [1, 3, 5, 7]
 */
fun removeDuplicateEntries(list1: List<Int>, list2: List<Int>): List<Int> {

    // Make a copy of list1 to avoid modifying the original list
    val result = list1.toMutableList()

    // Remove duplicate entries from list2
    val uniqueEntries = list2.toSet()

    // Iterate over the unique entries in list2
    for (entry in uniqueEntries) {
        // Check if the entry is present in result list
        if (entry in result) {
            // Remove the entry from the result list
            result.remove(entry)
        }
    }

    return result
}
/**
 * In this exercise, you need to remove duplicate entries from a set by copying lists.
 * The function takes two lists as input and should remove any duplicate entries present in the second list from the first list.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing duplicate entries to be removed.
 * @return Modified list1 after removing duplicate entries from list2.
 *
 * Example:
 * removeDuplicateEntries(listOf(1, 2, 3, 4, 5, 6, 7), listOf(2, 4, 6))
 * Expected output: [1, 3, 5, 7]
 */
fun removeDuplicateEntries(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * In this exercise, you need to remove duplicate entries from a set by copying lists.
 * The function takes two lists as input and should remove any duplicate entries present in the second list from the first list.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing duplicate entries to be removed.
 * @return Modified list1 after removing duplicate entries from list2.
 *
 * Example:
 * removeDuplicateEntries(listOf(1, 2, 3, 4, 5, 6, 7), listOf(2, 4, 6))
 * Expected output: [1, 3, 5, 7]
 */
fun removeDuplicateEntries(list1: List<Int>, list2: List<Int>): List<Int> {

    // Make a copy of list1 to avoid modifying the original list
    val result = list1.toMutableList()

    // Remove duplicate entries from list2
    val uniqueEntries = list2.toSet()

    // Iterate over the unique entries in list2
    for (entry in uniqueEntries) {
        // Check if the entry is present in result list
        if (entry in result) {
            // Remove the entry from the result list
            result.remove(entry)
        }
    }

    return result
}