/**
 * Given a tuple 'tup', slice and return a new tuple based on the provided conditions.
 *
 * @param tup The original tuple.
 * @param condition1 The first condition to filter the tuple.
 * @param condition2 The second condition to filter the tuple.
 * @return A new tuple with the elements that satisfy both conditions.
 *
 * Example:
 * sliceTupleWithConditions(listOf(1, 2, 3, 4, 5, 6), true, false) -> listOf(2, 4, 6)
 */
fun sliceTupleWithConditions(tup: List<Int>, condition1: Boolean, condition2: Boolean): List<Int> {

    // Use filtering to create a new list by applying multiple conditions

    // Use filter to check both conditions
    return tup.filter { value -> condition1 && condition2 }
}
/**
 * Given a tuple 'tup', slice and return a new tuple based on the provided conditions.
 *
 * @param tup The original tuple.
 * @param condition1 The first condition to filter the tuple.
 * @param condition2 The second condition to filter the tuple.
 * @return A new tuple with the elements that satisfy both conditions.
 *
 * Example:
 * sliceTupleWithConditions(listOf(1, 2, 3, 4, 5, 6), true, false) -> listOf(2, 4, 6)
 */
fun sliceTupleWithConditions(tup: List<Int>, condition1: Boolean, condition2: Boolean): List<Int> {
/**
 * Given a tuple 'tup', slice and return a new tuple based on the provided conditions.
 *
 * @param tup The original tuple.
 * @param condition1 The first condition to filter the tuple.
 * @param condition2 The second condition to filter the tuple.
 * @return A new tuple with the elements that satisfy both conditions.
 *
 * Example:
 * sliceTupleWithConditions(listOf(1, 2, 3, 4, 5, 6), true, false) -> listOf(2, 4, 6)
 */
fun sliceTupleWithConditions(tup: List<Int>, condition1: Boolean, condition2: Boolean): List<Int> {

    // Use filtering to create a new list by applying multiple conditions

    // Use filter to check both conditions
    return tup.filter { value -> condition1 && condition2 }
}