/**
 * Given two tuples 'tuple1" and 'tuple2`, combine them element-wise using a function 'func`.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @param func The function used to combine the elements of the tuples.
 * @return A new tuple with the combined elements.
 */
fun combineTuples(tuple1: List<Any>, tuple2: List<Any>, func: (Any, Any) -> Any): List<Any> {

    val result = mutableListOf<Any>()
    for (i in tuple1.indices) {
        result.add(func(tuple1[i], tuple2[i]))
    }
    return result
}

// Exercise:
/**
 * Given two tuples 'tuple1" and 'tuple2`, combine them element-wise using a function 'func`.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @param func The function used to combine the elements of the tuples.
 * @return A new tuple with the combined elements.
 */
fun combineTuples(tuple1: List<Any>, tuple2: List<Any>, func: (Any, Any) -> Any): List<Any> {
/**
 * Given two tuples 'tuple1" and 'tuple2`, combine them element-wise using a function 'func`.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @param func The function used to combine the elements of the tuples.
 * @return A new tuple with the combined elements.
 */
fun combineTuples(tuple1: List<Any>, tuple2: List<Any>, func: (Any, Any) -> Any): List<Any> {

    val result = mutableListOf<Any>()
    for (i in tuple1.indices) {
        result.add(func(tuple1[i], tuple2[i]))
    }
    return result
}

// Exercise: