/**
 * Find the common elements between two tuples and return them as a new tuple,
 * preserving their original order.
 *
 * @param tuple1 A tuple containing elements.
 * @param tuple2 Another tuple containing elements.
 * @return A new tuple with the common elements in the same order they appear in the
 * input tuples.
 */
fun findCommonElements(tuple1: List<Any>, tuple2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element in tuple1) {
        if (element in tuple2) {
            commonElements.add(element)
        }
    }
    return commonElements
}
/**
 * Find the common elements between two tuples and return them as a new tuple,
 * preserving their original order.
 *
 * @param tuple1 A tuple containing elements.
 * @param tuple2 Another tuple containing elements.
 * @return A new tuple with the common elements in the same order they appear in the
 * input tuples.
 */
fun findCommonElements(tuple1: List<Any>, tuple2: List<Any>): List<Any> {
/**
 * Find the common elements between two tuples and return them as a new tuple,
 * preserving their original order.
 *
 * @param tuple1 A tuple containing elements.
 * @param tuple2 Another tuple containing elements.
 * @return A new tuple with the common elements in the same order they appear in the
 * input tuples.
 */
fun findCommonElements(tuple1: List<Any>, tuple2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element in tuple1) {
        if (element in tuple2) {
            commonElements.add(element)
        }
    }
    return commonElements
}