/**
 * Given a number line and a sequence of numbers, find the intersection of the number line
 * with the numbers in the sequence.
 *
 * @param numberLine A list of integers representing the number line.
 * @param sequence A list of integers representing a sequence of numbers.
 * @return A list containing the numbers from the sequence that lie on the number line.
 *
 * Example:
 * val numberLine = listOf(-10, -5, 0, 5, 10)
 * val sequence = listOf(-8, -5, 4, 7, 12)
 * intersectionOfNumberLineAndSequence(numberLine, sequence) // Output: [-5, 4]
 */
fun intersectionOfNumberLineAndSequence(numberLine: List<Int>, sequence: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    for (num in sequence) {
        if (num in numberLine) {
            intersection.add(num)
        }
    }

    return intersection
}
/**
 * Given a number line and a sequence of numbers, find the intersection of the number line
 * with the numbers in the sequence.
 *
 * @param numberLine A list of integers representing the number line.
 * @param sequence A list of integers representing a sequence of numbers.
 * @return A list containing the numbers from the sequence that lie on the number line.
 *
 * Example:
 * val numberLine = listOf(-10, -5, 0, 5, 10)
 * val sequence = listOf(-8, -5, 4, 7, 12)
 * intersectionOfNumberLineAndSequence(numberLine, sequence) // Output: [-5, 4]
 */
fun intersectionOfNumberLineAndSequence(numberLine: List<Int>, sequence: List<Int>): List<Int> {
/**
 * Given a number line and a sequence of numbers, find the intersection of the number line
 * with the numbers in the sequence.
 *
 * @param numberLine A list of integers representing the number line.
 * @param sequence A list of integers representing a sequence of numbers.
 * @return A list containing the numbers from the sequence that lie on the number line.
 *
 * Example:
 * val numberLine = listOf(-10, -5, 0, 5, 10)
 * val sequence = listOf(-8, -5, 4, 7, 12)
 * intersectionOfNumberLineAndSequence(numberLine, sequence) // Output: [-5, 4]
 */
fun intersectionOfNumberLineAndSequence(numberLine: List<Int>, sequence: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    for (num in sequence) {
        if (num in numberLine) {
            intersection.add(num)
        }
    }

    return intersection
}