/**
 * This function iterates over a sequence and finds the elements that are not present in the complement.
 * The new list contains only the unique elements from the sequence that are not in the complement.
 *
 * @param sequence The original sequence of elements.
 * @param complement The complement of the sequence.
 * @return New list containing the intersected elements.
 */
fun intersectSequenceComplement(sequence: List<Any>, complement: List<Any>): List<Any> {

    // Create a set from the complement list
    val complementSet = complement.toSet()

    // Initialize an empty list to store the intersected elements
    val intersectedElements = mutableListOf<Any>()

    // Iterate over each element in the sequence
    for (element in sequence) {
        // Check if the element is not in the complement set
        if (element !in complementSet) {
            // Add the element to the intersectedElements list
            intersectedElements.add(element)
        }
    }

    return intersectedElements
}
/**
 * This function iterates over a sequence and finds the elements that are not present in the complement.
 * The new list contains only the unique elements from the sequence that are not in the complement.
 *
 * @param sequence The original sequence of elements.
 * @param complement The complement of the sequence.
 * @return New list containing the intersected elements.
 */
fun intersectSequenceComplement(sequence: List<Any>, complement: List<Any>): List<Any> {
/**
 * This function iterates over a sequence and finds the elements that are not present in the complement.
 * The new list contains only the unique elements from the sequence that are not in the complement.
 *
 * @param sequence The original sequence of elements.
 * @param complement The complement of the sequence.
 * @return New list containing the intersected elements.
 */
fun intersectSequenceComplement(sequence: List<Any>, complement: List<Any>): List<Any> {

    // Create a set from the complement list
    val complementSet = complement.toSet()

    // Initialize an empty list to store the intersected elements
    val intersectedElements = mutableListOf<Any>()

    // Iterate over each element in the sequence
    for (element in sequence) {
        // Check if the element is not in the complement set
        if (element !in complementSet) {
            // Add the element to the intersectedElements list
            intersectedElements.add(element)
        }
    }

    return intersectedElements
}