/**
 * Given two lists, this function returns a new list that contains the exclusive OR (XOR) of the elements present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A new list with the XOR of the elements
 *
 * Example:
 * xorLists(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [1, 2, 5, 6]
 * xorLists(listOf(7, 8, 9), listOf(8, 9, 10)) -> [7, 10]
 */
fun xorLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val xorResult = mutableListOf<Int>() // Empty list to store the XOR result

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

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

    return xorResult
}
/**
 * Given two lists, this function returns a new list that contains the exclusive OR (XOR) of the elements present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A new list with the XOR of the elements
 *
 * Example:
 * xorLists(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [1, 2, 5, 6]
 * xorLists(listOf(7, 8, 9), listOf(8, 9, 10)) -> [7, 10]
 */
fun xorLists(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, this function returns a new list that contains the exclusive OR (XOR) of the elements present in both lists.
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A new list with the XOR of the elements
 *
 * Example:
 * xorLists(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [1, 2, 5, 6]
 * xorLists(listOf(7, 8, 9), listOf(8, 9, 10)) -> [7, 10]
 */
fun xorLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val xorResult = mutableListOf<Int>() // Empty list to store the XOR result

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

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

    return xorResult
}