/**
 * This function takes two tuples as input and returns a tuple that contains only the elements that are common
 * in both tuples. The order of the elements should be preserved in the resulting tuple.
 *
 * @param t1 First input tuple
 * @param t2 Second input tuple
 * @return Tuple containing elements common to both input tuples
 *
 * Example:
 * intersectionOfTuples(listOf('a', 'b', 'c', 'd'), listOf('b', 'd', 'e')) // ['b', 'd']
 * intersectionOfTuples(listOf(1, 2, 3, 4), listOf(3, 4, 5)) // [3, 4]
 */
fun intersectionOfTuples(t1: List<Any>, t2: List<Any>): List<Any> {

    val commonElements = t1.filter { it in t2 }
    return commonElements
}
/**
 * This function takes two tuples as input and returns a tuple that contains only the elements that are common
 * in both tuples. The order of the elements should be preserved in the resulting tuple.
 *
 * @param t1 First input tuple
 * @param t2 Second input tuple
 * @return Tuple containing elements common to both input tuples
 *
 * Example:
 * intersectionOfTuples(listOf('a', 'b', 'c', 'd'), listOf('b', 'd', 'e')) // ['b', 'd']
 * intersectionOfTuples(listOf(1, 2, 3, 4), listOf(3, 4, 5)) // [3, 4]
 */
fun intersectionOfTuples(t1: List<Any>, t2: List<Any>): List<Any> {
/**
 * This function takes two tuples as input and returns a tuple that contains only the elements that are common
 * in both tuples. The order of the elements should be preserved in the resulting tuple.
 *
 * @param t1 First input tuple
 * @param t2 Second input tuple
 * @return Tuple containing elements common to both input tuples
 *
 * Example:
 * intersectionOfTuples(listOf('a', 'b', 'c', 'd'), listOf('b', 'd', 'e')) // ['b', 'd']
 * intersectionOfTuples(listOf(1, 2, 3, 4), listOf(3, 4, 5)) // [3, 4]
 */
fun intersectionOfTuples(t1: List<Any>, t2: List<Any>): List<Any> {

    val commonElements = t1.filter { it in t2 }
    return commonElements
}