/**
 * This function takes in two lists and a condition, and returns a copy of elements from the first list that satisfy the condition.
 *
 * @param list1 The first list containing elements to be copied.
 * @param list2 The second list containing the conditions to be checked.
 * @param condition The condition to be evaluated for each element in the first list.
 * @return A new list containing only the elements from the first list that satisfy the condition.
 */
fun copySelectedElements(list1: List<Any>, list2: List<Boolean>, condition: (Boolean) -> Boolean): List<Any> {

    val selectedElements = mutableListOf<Any>()

    for ((element, cond) in list1.zip(list2)) {
        if (condition(cond)) {
            selectedElements.add(element)
        }
    }

    return selectedElements
}
/**
 * This function takes in two lists and a condition, and returns a copy of elements from the first list that satisfy the condition.
 *
 * @param list1 The first list containing elements to be copied.
 * @param list2 The second list containing the conditions to be checked.
 * @param condition The condition to be evaluated for each element in the first list.
 * @return A new list containing only the elements from the first list that satisfy the condition.
 */
fun copySelectedElements(list1: List<Any>, list2: List<Boolean>, condition: (Boolean) -> Boolean): List<Any> {
/**
 * This function takes in two lists and a condition, and returns a copy of elements from the first list that satisfy the condition.
 *
 * @param list1 The first list containing elements to be copied.
 * @param list2 The second list containing the conditions to be checked.
 * @param condition The condition to be evaluated for each element in the first list.
 * @return A new list containing only the elements from the first list that satisfy the condition.
 */
fun copySelectedElements(list1: List<Any>, list2: List<Boolean>, condition: (Boolean) -> Boolean): List<Any> {

    val selectedElements = mutableListOf<Any>()

    for ((element, cond) in list1.zip(list2)) {
        if (condition(cond)) {
            selectedElements.add(element)
        }
    }

    return selectedElements
}