/**
 * Given two integers a and b, and a list representing a number line, find the intersection
 * of the number line with the interval [a, b]. The number line is assumed to be sorted in
 * ascending order.
 *
 * For example, if a = 2, b = 6, and numLine = [1, 2, 3, 4, 5, 6, 7, 8], the intersection
 * would be [2, 3, 4, 5, 6].
 */
fun findIntersection(a: Int, b: Int, numLine: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Check if a is greater than the last element of the number line
    if (a > numLine.last()) {
        return intersection
    }

    // Check if b is less than the first element of the number line
    if (b < numLine.first()) {
        return intersection
    }

    // Find the starting index for the intersection
    var startIndex = 0
    for (i in numLine.indices) {
        if (numLine[i] >= a) {
            startIndex = i
            break
        }
    }

    // Find the ending index
    // TODO: Continue implementation for finding the ending index

    return intersection
}
/**
 * Given two integers a and b, and a list representing a number line, find the intersection
 * of the number line with the interval [a, b]. The number line is assumed to be sorted in
 * ascending order.
 *
 * For example, if a = 2, b = 6, and numLine = [1, 2, 3, 4, 5, 6, 7, 8], the intersection
 * would be [2, 3, 4, 5, 6].
 */
fun findIntersection(a: Int, b: Int, numLine: List<Int>): List<Int> {
/**
 * Given two integers a and b, and a list representing a number line, find the intersection
 * of the number line with the interval [a, b]. The number line is assumed to be sorted in
 * ascending order.
 *
 * For example, if a = 2, b = 6, and numLine = [1, 2, 3, 4, 5, 6, 7, 8], the intersection
 * would be [2, 3, 4, 5, 6].
 */
fun findIntersection(a: Int, b: Int, numLine: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Check if a is greater than the last element of the number line
    if (a > numLine.last()) {
        return intersection
    }

    // Check if b is less than the first element of the number line
    if (b < numLine.first()) {
        return intersection
    }

    // Find the starting index for the intersection
    var startIndex = 0
    for (i in numLine.indices) {
        if (numLine[i] >= a) {
            startIndex = i
            break
        }
    }

    // Find the ending index
    // TODO: Continue implementation for finding the ending index

    return intersection
}