/**
 * Given two lists, return the complement of their intersection.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return The complement of the intersection of list1 and list2.
 *
 * Example:
 * complementOfIntersection(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns [1, 2, 3, 6, 7, 8]
 */
fun complementOfIntersection(list1: List<Int>, list2: List<Int>): List<Int> {

    // Find the intersection of the two lists
    val intersection = list1.intersect(list2)

    // Find the complement of the intersection
    val complement = (list1 + list2).distinct().filter { it !in intersection }

    return complement
}
/**
 * Given two lists, return the complement of their intersection.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return The complement of the intersection of list1 and list2.
 *
 * Example:
 * complementOfIntersection(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns [1, 2, 3, 6, 7, 8]
 */
fun complementOfIntersection(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, return the complement of their intersection.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return The complement of the intersection of list1 and list2.
 *
 * Example:
 * complementOfIntersection(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns [1, 2, 3, 6, 7, 8]
 */
fun complementOfIntersection(list1: List<Int>, list2: List<Int>): List<Int> {

    // Find the intersection of the two lists
    val intersection = list1.intersect(list2)

    // Find the complement of the intersection
    val complement = (list1 + list2).distinct().filter { it !in intersection }

    return complement
}