/**
 * This function returns the intersection of two number lines using the AND operator.
 *
 * @param numberLineA A list representing the first number line.
 * @param numberLineB A list representing the second number line.
 * @return A list containing the common elements between the two number lines.
 *
 * Example:
 * intersectionAndOperator(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) // [4, 5]
 */
fun intersectionAndOperator(numberLineA: List<Int>, numberLineB: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()
    for (element in numberLineA) {
        if (element in numberLineB) {
            intersection.add(element)
        }
    }
    return intersection
}
/**
 * This function returns the intersection of two number lines using the AND operator.
 *
 * @param numberLineA A list representing the first number line.
 * @param numberLineB A list representing the second number line.
 * @return A list containing the common elements between the two number lines.
 *
 * Example:
 * intersectionAndOperator(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) // [4, 5]
 */
fun intersectionAndOperator(numberLineA: List<Int>, numberLineB: List<Int>): List<Int> {
/**
 * This function returns the intersection of two number lines using the AND operator.
 *
 * @param numberLineA A list representing the first number line.
 * @param numberLineB A list representing the second number line.
 * @return A list containing the common elements between the two number lines.
 *
 * Example:
 * intersectionAndOperator(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) // [4, 5]
 */
fun intersectionAndOperator(numberLineA: List<Int>, numberLineB: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()
    for (element in numberLineA) {
        if (element in numberLineB) {
            intersection.add(element)
        }
    }
    return intersection
}