/**
 * This function takes in two parameters, start and stop, and returns a list of numbers
 * within the range [start, stop) where the XOR of all the numbers is the maximum possible.
 */
fun xorRange(start: Int, stop: Int): List<Int> {

    val xorValues = mutableListOf<Int>()

    for (num in start until stop) {
        var xorVal = 0

        for (i in start until stop) {
            xorVal = maxOf(xorVal, num xor i)
        }

        xorValues.add(xorVal)
    }

    val maxXorIndex = xorValues.indexOf(xorValues.maxOrNull())

    val xorRange = (start until stop).toList()

    return xorRange.subList(maxXorIndex, xorRange.size)
}
/**
 * This function takes in two parameters, start and stop, and returns a list of numbers
 * within the range [start, stop) where the XOR of all the numbers is the maximum possible.
 */
fun xorRange(start: Int, stop: Int): List<Int> {
/**
 * This function takes in two parameters, start and stop, and returns a list of numbers
 * within the range [start, stop) where the XOR of all the numbers is the maximum possible.
 */
fun xorRange(start: Int, stop: Int): List<Int> {

    val xorValues = mutableListOf<Int>()

    for (num in start until stop) {
        var xorVal = 0

        for (i in start until stop) {
            xorVal = maxOf(xorVal, num xor i)
        }

        xorValues.add(xorVal)
    }

    val maxXorIndex = xorValues.indexOf(xorValues.maxOrNull())

    val xorRange = (start until stop).toList()

    return xorRange.subList(maxXorIndex, xorRange.size)
}