/**
 * Given a range and a list of excluded elements, this function returns a new list that contains all the elements
 * within the range that are not present in the excluded elements list.
 *
 * @param rangeStart The starting value of the range (inclusive).
 * @param rangeEnd The ending value of the range (exclusive).
 * @param excludedElements List of elements to be excluded.
 * @return List of elements within the range that are not present in the excluded elements list.
 *
 * Example:
 * notInOperatorIteration(1, 10, listOf(2, 4, 6, 8)) // [1, 3, 5, 7, 9]
 */
fun notInOperatorIteration(rangeStart: Int, rangeEnd: Int, excludedElements: List<Int>): List<Int> {

    // Generate a list of all elements in the given range
    val elementsInRange = (rangeStart until rangeEnd).toList()

    // Use filter to exclude elements present in the excludedElements list
    val filteredElements = elementsInRange.filter { it !in excludedElements }

    return filteredElements
}
/**
 * Given a range and a list of excluded elements, this function returns a new list that contains all the elements
 * within the range that are not present in the excluded elements list.
 *
 * @param rangeStart The starting value of the range (inclusive).
 * @param rangeEnd The ending value of the range (exclusive).
 * @param excludedElements List of elements to be excluded.
 * @return List of elements within the range that are not present in the excluded elements list.
 *
 * Example:
 * notInOperatorIteration(1, 10, listOf(2, 4, 6, 8)) // [1, 3, 5, 7, 9]
 */
fun notInOperatorIteration(rangeStart: Int, rangeEnd: Int, excludedElements: List<Int>): List<Int> {
/**
 * Given a range and a list of excluded elements, this function returns a new list that contains all the elements
 * within the range that are not present in the excluded elements list.
 *
 * @param rangeStart The starting value of the range (inclusive).
 * @param rangeEnd The ending value of the range (exclusive).
 * @param excludedElements List of elements to be excluded.
 * @return List of elements within the range that are not present in the excluded elements list.
 *
 * Example:
 * notInOperatorIteration(1, 10, listOf(2, 4, 6, 8)) // [1, 3, 5, 7, 9]
 */
fun notInOperatorIteration(rangeStart: Int, rangeEnd: Int, excludedElements: List<Int>): List<Int> {

    // Generate a list of all elements in the given range
    val elementsInRange = (rangeStart until rangeEnd).toList()

    // Use filter to exclude elements present in the excludedElements list
    val filteredElements = elementsInRange.filter { it !in excludedElements }

    return filteredElements
}