/**
 * This function takes in two tuples and compares them using the XOR operator.
 * It returns a new tuple in which each element is the XOR result of the corresponding elements from the input tuples.
 * The input tuples must have the same length.
 *
 * @param tuple1 The first tuple to be compared.
 * @param tuple2 The second tuple to be compared.
 * @return A new tuple containing the XOR results.
 * @throws IllegalArgumentException If the input tuples have different lengths.
 *
 * Example:
 * Input:
 * tuple1 = (1, 2, 3)
 * tuple2 = (4, 5, 6)
 *
 * Output:
 * (5, 7, 5)
 */
fun compareTuplesXor(tuple1: List<Int>, tuple2: List<Int>): List<Int> {

    if (tuple1.size != tuple2.size) {
        throw IllegalArgumentException("Input tuples must have the same length")
    }

    val xorResult = mutableListOf<Int>()

    for (i in tuple1.indices) {
        xorResult.add(tuple1[i] xor tuple2[i])
    }

    return xorResult
}
/**
 * This function takes in two tuples and compares them using the XOR operator.
 * It returns a new tuple in which each element is the XOR result of the corresponding elements from the input tuples.
 * The input tuples must have the same length.
 *
 * @param tuple1 The first tuple to be compared.
 * @param tuple2 The second tuple to be compared.
 * @return A new tuple containing the XOR results.
 * @throws IllegalArgumentException If the input tuples have different lengths.
 *
 * Example:
 * Input:
 * tuple1 = (1, 2, 3)
 * tuple2 = (4, 5, 6)
 *
 * Output:
 * (5, 7, 5)
 */
fun compareTuplesXor(tuple1: List<Int>, tuple2: List<Int>): List<Int> {
/**
 * This function takes in two tuples and compares them using the XOR operator.
 * It returns a new tuple in which each element is the XOR result of the corresponding elements from the input tuples.
 * The input tuples must have the same length.
 *
 * @param tuple1 The first tuple to be compared.
 * @param tuple2 The second tuple to be compared.
 * @return A new tuple containing the XOR results.
 * @throws IllegalArgumentException If the input tuples have different lengths.
 *
 * Example:
 * Input:
 * tuple1 = (1, 2, 3)
 * tuple2 = (4, 5, 6)
 *
 * Output:
 * (5, 7, 5)
 */
fun compareTuplesXor(tuple1: List<Int>, tuple2: List<Int>): List<Int> {

    if (tuple1.size != tuple2.size) {
        throw IllegalArgumentException("Input tuples must have the same length")
    }

    val xorResult = mutableListOf<Int>()

    for (i in tuple1.indices) {
        xorResult.add(tuple1[i] xor tuple2[i])
    }

    return xorResult
}