/**
 * Input:
 * - numbers: a list of integers representing a number line
 * - lineSegment: a Pair with two integers representing the start and end points of the line segment
 *
 * Output:
 * - A list of integers representing the intersection points of the number line with the line segment
 *
 * Example:
 * numbers = [0, 1, 2, 3, 4, 5]
 * lineSegment = Pair(1, 4)
 *
 * Output:
 * [1, 2, 3, 4]
 */
fun findIntersection(numbers: List<Int>, lineSegment: Pair<Int, Int>): List<Int> {

    val intersectionPoints = mutableListOf<Int>()

    // Iterate over each number in the given list
    for (number in numbers) {
        // Check if the number is within the start and end points of the line segment
        if (lineSegment.first <= number && number <= lineSegment.second) {
            intersectionPoints.add(number) // Add the number to intersection points list
        }
    }

    return intersectionPoints
}
/**
 * Input:
 * - numbers: a list of integers representing a number line
 * - lineSegment: a Pair with two integers representing the start and end points of the line segment
 *
 * Output:
 * - A list of integers representing the intersection points of the number line with the line segment
 *
 * Example:
 * numbers = [0, 1, 2, 3, 4, 5]
 * lineSegment = Pair(1, 4)
 *
 * Output:
 * [1, 2, 3, 4]
 */
fun findIntersection(numbers: List<Int>, lineSegment: Pair<Int, Int>): List<Int> {
/**
 * Input:
 * - numbers: a list of integers representing a number line
 * - lineSegment: a Pair with two integers representing the start and end points of the line segment
 *
 * Output:
 * - A list of integers representing the intersection points of the number line with the line segment
 *
 * Example:
 * numbers = [0, 1, 2, 3, 4, 5]
 * lineSegment = Pair(1, 4)
 *
 * Output:
 * [1, 2, 3, 4]
 */
fun findIntersection(numbers: List<Int>, lineSegment: Pair<Int, Int>): List<Int> {

    val intersectionPoints = mutableListOf<Int>()

    // Iterate over each number in the given list
    for (number in numbers) {
        // Check if the number is within the start and end points of the line segment
        if (lineSegment.first <= number && number <= lineSegment.second) {
            intersectionPoints.add(number) // Add the number to intersection points list
        }
    }

    return intersectionPoints
}