/**
 * This function takes in two lists of integers and returns a new list containing the elements that are present in either of the lists but not in both using the XOR operator.
 *
 * @param list1 The first list of integers.
 * @param list2 The second list of integers.
 * @return A new list containing the elements present in either of the input lists but not in both.
 *
 * Example:
 * xorLists(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns [1, 2, 3, 6, 7, 8]
 */
fun xorLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val result = mutableListOf<Int>()
    for (num in list1) {
        if (num !in list2) {
            result.add(num)
        }
    }
    for (num in list2) {
        if (num !in list1) {
            result.add(num)
        }
    }
    return result
}
/**
 * This function takes in two lists of integers and returns a new list containing the elements that are present in either of the lists but not in both using the XOR operator.
 *
 * @param list1 The first list of integers.
 * @param list2 The second list of integers.
 * @return A new list containing the elements present in either of the input lists but not in both.
 *
 * Example:
 * xorLists(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns [1, 2, 3, 6, 7, 8]
 */
fun xorLists(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * This function takes in two lists of integers and returns a new list containing the elements that are present in either of the lists but not in both using the XOR operator.
 *
 * @param list1 The first list of integers.
 * @param list2 The second list of integers.
 * @return A new list containing the elements present in either of the input lists but not in both.
 *
 * Example:
 * xorLists(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns [1, 2, 3, 6, 7, 8]
 */
fun xorLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val result = mutableListOf<Int>()
    for (num in list1) {
        if (num !in list2) {
            result.add(num)
        }
    }
    for (num in list2) {
        if (num !in list1) {
            result.add(num)
        }
    }
    return result
}