/**
 * The function takes two numbers as input and returns a list containing all the numbers
 * between them (inclusive) that are divisible by 5 and also divisible by 3. However, if a
 * number is divisible by 2 and the previous number is divisible by 7, it should be skipped.
 */
fun compareNumbers(num1: Int, num2: Int): List<Int> {

    val result = mutableListOf<Int>()

    var start = num1
    var end = num2
    if (num2 < num1) {
        start = num2
        end = num1
    }

    for (num in start..end) {
        if (num % 5 == 0 && num % 3 == 0) {
            if (num % 2 == 0 && result.isNotEmpty() && result.last() % 7 == 0) {
                continue
            }
            result.add(num)
        }
    }

    return result
}
/**
 * The function takes two numbers as input and returns a list containing all the numbers
 * between them (inclusive) that are divisible by 5 and also divisible by 3. However, if a
 * number is divisible by 2 and the previous number is divisible by 7, it should be skipped.
 */
fun compareNumbers(num1: Int, num2: Int): List<Int> {
/**
 * The function takes two numbers as input and returns a list containing all the numbers
 * between them (inclusive) that are divisible by 5 and also divisible by 3. However, if a
 * number is divisible by 2 and the previous number is divisible by 7, it should be skipped.
 */
fun compareNumbers(num1: Int, num2: Int): List<Int> {

    val result = mutableListOf<Int>()

    var start = num1
    var end = num2
    if (num2 < num1) {
        start = num2
        end = num1
    }

    for (num in start..end) {
        if (num % 5 == 0 && num % 3 == 0) {
            if (num % 2 == 0 && result.isNotEmpty() && result.last() % 7 == 0) {
                continue
            }
            result.add(num)
        }
    }

    return result
}