/**
 * Given two operands, a condition, and a list of numbers, the function calculates the intersection
 * of the two operands based on the condition and returns a new list containing only the intersecting elements.
 *
 * @param operand1 The first operand (integer) to compare.
 * @param operand2 The second operand (integer) to compare.
 * @param condition The condition (boolean expression) to evaluate while comparing the operands.
 * @param list_of_numbers A list of integers.
 * @return A new list containing the intersecting elements based on the condition.
 *
 * Example:
 * calculateIntersection(3, 7, true, listOf(1, 2, 3, 4, 5, 6, 7, 8, 9))
 * => [1, 2, 3, 8, 9]
 */
fun calculateIntersection(operand1: Int, operand2: Int, condition: Boolean, list_of_numbers: List<Int>): List<Int> {

    return list_of_numbers.filter { number -> if (condition) number == operand1 else number == operand2 }
}
/**
 * Given two operands, a condition, and a list of numbers, the function calculates the intersection
 * of the two operands based on the condition and returns a new list containing only the intersecting elements.
 *
 * @param operand1 The first operand (integer) to compare.
 * @param operand2 The second operand (integer) to compare.
 * @param condition The condition (boolean expression) to evaluate while comparing the operands.
 * @param list_of_numbers A list of integers.
 * @return A new list containing the intersecting elements based on the condition.
 *
 * Example:
 * calculateIntersection(3, 7, true, listOf(1, 2, 3, 4, 5, 6, 7, 8, 9))
 * => [1, 2, 3, 8, 9]
 */
fun calculateIntersection(operand1: Int, operand2: Int, condition: Boolean, list_of_numbers: List<Int>): List<Int> {
/**
 * Given two operands, a condition, and a list of numbers, the function calculates the intersection
 * of the two operands based on the condition and returns a new list containing only the intersecting elements.
 *
 * @param operand1 The first operand (integer) to compare.
 * @param operand2 The second operand (integer) to compare.
 * @param condition The condition (boolean expression) to evaluate while comparing the operands.
 * @param list_of_numbers A list of integers.
 * @return A new list containing the intersecting elements based on the condition.
 *
 * Example:
 * calculateIntersection(3, 7, true, listOf(1, 2, 3, 4, 5, 6, 7, 8, 9))
 * => [1, 2, 3, 8, 9]
 */
fun calculateIntersection(operand1: Int, operand2: Int, condition: Boolean, list_of_numbers: List<Int>): List<Int> {

    return list_of_numbers.filter { number -> if (condition) number == operand1 else number == operand2 }
}