/**
 * Given a list of values and a comparison function, this function returns
 * a list of the values that satisfy the comparison condition.
 *
 * @param iterable List or tuple of values.
 * @param compareFunc Comparison function that takes two arguments and
 * returns a boolean value indicating the comparison result.
 * @return List of values that satisfy the comparison condition.
 */
fun checkIntersection(iterable: List<Int>, compareFunc: (Int) -> Boolean): List<Int> {

    val result = mutableListOf<Int>()
    for (value in iterable) {
        if (compareFunc(value)) {
            result.add(value)
        }
    }
    return result
}

// Example Usage:
/**
 * Given a list of values and a comparison function, this function returns
 * a list of the values that satisfy the comparison condition.
 *
 * @param iterable List or tuple of values.
 * @param compareFunc Comparison function that takes two arguments and
 * returns a boolean value indicating the comparison result.
 * @return List of values that satisfy the comparison condition.
 */
fun checkIntersection(iterable: List<Int>, compareFunc: (Int) -> Boolean): List<Int> {
/**
 * Given a list of values and a comparison function, this function returns
 * a list of the values that satisfy the comparison condition.
 *
 * @param iterable List or tuple of values.
 * @param compareFunc Comparison function that takes two arguments and
 * returns a boolean value indicating the comparison result.
 * @return List of values that satisfy the comparison condition.
 */
fun checkIntersection(iterable: List<Int>, compareFunc: (Int) -> Boolean): List<Int> {

    val result = mutableListOf<Int>()
    for (value in iterable) {
        if (compareFunc(value)) {
            result.add(value)
        }
    }
    return result
}

// Example Usage: