/**
 * Given an array of integers and a target value, find the indices of two elements in the array whose XOR is equal to the target value.
 * Return a list of pairs, where each pair contains the indices of the two elements.
 * If no such elements exist, return an empty list.
 *
 * @param array List of integers.
 * @param value Target value for XOR operation.
 * @return List of pairs containing the indices of two elements.
 */
fun xorIndex(array: List<Int>, value: Int): List<Pair<Int, Int>> {

    val indices = mutableListOf<Pair<Int, Int>>()
    for (i in array.indices) {
        for (j in array.indices) {
            if (i != j && (array[i] xor array[j]) == value) {
                indices.add(Pair(i, j))
            }
        }
    }
    return indices
}
/**
 * Given an array of integers and a target value, find the indices of two elements in the array whose XOR is equal to the target value.
 * Return a list of pairs, where each pair contains the indices of the two elements.
 * If no such elements exist, return an empty list.
 *
 * @param array List of integers.
 * @param value Target value for XOR operation.
 * @return List of pairs containing the indices of two elements.
 */
fun xorIndex(array: List<Int>, value: Int): List<Pair<Int, Int>> {
/**
 * Given an array of integers and a target value, find the indices of two elements in the array whose XOR is equal to the target value.
 * Return a list of pairs, where each pair contains the indices of the two elements.
 * If no such elements exist, return an empty list.
 *
 * @param array List of integers.
 * @param value Target value for XOR operation.
 * @return List of pairs containing the indices of two elements.
 */
fun xorIndex(array: List<Int>, value: Int): List<Pair<Int, Int>> {

    val indices = mutableListOf<Pair<Int, Int>>()
    for (i in array.indices) {
        for (j in array.indices) {
            if (i != j && (array[i] xor array[j]) == value) {
                indices.add(Pair(i, j))
            }
        }
    }
    return indices
}