/**
 * Given two numbers n1 and n2, find all the numbers between n1 and n2 (inclusive)
 * that are divisible by 3 or 5 but not both, using a while loop and the XOR operator (^).
 *
 * @param n1 The start number (integer) in the range.
 * @param n2 The end number (integer) in the range.
 * @return A list of numbers between n1 and n2 (inclusive) that are divisible by 3 or 5 but not both.
 *
 * Example:
 * xorLoop(10, 25) -> [10, 15, 20, 25]
 * xorLoop(30, 50) -> [30, 33, 40, 45, 50]
 */
fun xorLoop(n1: Int, n2: Int): List<Int> {

    val result = mutableListOf<Int>()
    var i = n1

    while (i <= n2) {
        if ((i % 3 == 0) xor (i % 5 == 0)) {
            result.add(i)
        }
        i++
    }

    return result
}
/**
 * Given two numbers n1 and n2, find all the numbers between n1 and n2 (inclusive)
 * that are divisible by 3 or 5 but not both, using a while loop and the XOR operator (^).
 *
 * @param n1 The start number (integer) in the range.
 * @param n2 The end number (integer) in the range.
 * @return A list of numbers between n1 and n2 (inclusive) that are divisible by 3 or 5 but not both.
 *
 * Example:
 * xorLoop(10, 25) -> [10, 15, 20, 25]
 * xorLoop(30, 50) -> [30, 33, 40, 45, 50]
 */
fun xorLoop(n1: Int, n2: Int): List<Int> {
/**
 * Given two numbers n1 and n2, find all the numbers between n1 and n2 (inclusive)
 * that are divisible by 3 or 5 but not both, using a while loop and the XOR operator (^).
 *
 * @param n1 The start number (integer) in the range.
 * @param n2 The end number (integer) in the range.
 * @return A list of numbers between n1 and n2 (inclusive) that are divisible by 3 or 5 but not both.
 *
 * Example:
 * xorLoop(10, 25) -> [10, 15, 20, 25]
 * xorLoop(30, 50) -> [30, 33, 40, 45, 50]
 */
fun xorLoop(n1: Int, n2: Int): List<Int> {

    val result = mutableListOf<Int>()
    var i = n1

    while (i <= n2) {
        if ((i % 3 == 0) xor (i % 5 == 0)) {
            result.add(i)
        }
        i++
    }

    return result
}