/**
 * This exercise requires creating a range with start and stop parameters and using the OR operator to calculate the intersection.
 *
 * The function should take two integers, start and stop, as inputs and return a list of even numbers greater than or equal to start and less than or equal to stop, or odd numbers greater than or equal to start and less than or equal to stop.
 *
 * @param start The starting point of the range.
 * @param stop The ending point of the range.
 * @return A list of even or odd numbers within the specified range.
 *
 * Example:
 * Start = 3, Stop = 10
 * Output: [3, 5, 7, 9]
 */
fun intersectionEconomist(start: Int, stop: Int): List<Int> {

    var newStart = start
    var newStop = stop

    if (start % 2 == 0) {  // If start is even
        newStart++         // Increment start by 1 to make it odd
    }

    if (stop % 2 == 0) {   // If stop is even
        newStop--           // Decrement stop by 1 to make it odd
    }

    if (newStart > newStop) {
        return emptyList()  // If start is greater than stop, return an empty list
    }

    return (newStart..newStop step 2).toList()
}
/**
 * This exercise requires creating a range with start and stop parameters and using the OR operator to calculate the intersection.
 *
 * The function should take two integers, start and stop, as inputs and return a list of even numbers greater than or equal to start and less than or equal to stop, or odd numbers greater than or equal to start and less than or equal to stop.
 *
 * @param start The starting point of the range.
 * @param stop The ending point of the range.
 * @return A list of even or odd numbers within the specified range.
 *
 * Example:
 * Start = 3, Stop = 10
 * Output: [3, 5, 7, 9]
 */
fun intersectionEconomist(start: Int, stop: Int): List<Int> {
/**
 * This exercise requires creating a range with start and stop parameters and using the OR operator to calculate the intersection.
 *
 * The function should take two integers, start and stop, as inputs and return a list of even numbers greater than or equal to start and less than or equal to stop, or odd numbers greater than or equal to start and less than or equal to stop.
 *
 * @param start The starting point of the range.
 * @param stop The ending point of the range.
 * @return A list of even or odd numbers within the specified range.
 *
 * Example:
 * Start = 3, Stop = 10
 * Output: [3, 5, 7, 9]
 */
fun intersectionEconomist(start: Int, stop: Int): List<Int> {

    var newStart = start
    var newStop = stop

    if (start % 2 == 0) {  // If start is even
        newStart++         // Increment start by 1 to make it odd
    }

    if (stop % 2 == 0) {   // If stop is even
        newStop--           // Decrement stop by 1 to make it odd
    }

    if (newStart > newStop) {
        return emptyList()  // If start is greater than stop, return an empty list
    }

    return (newStart..newStop step 2).toList()
}