/**
 * This function takes two tuples and returns a new tuple containing the elements that are common to both tuples.
 *
 * @param t1 A tuple containing multiple elements.
 * @param t2 A tuple containing multiple elements.
 * @return A new tuple containing the common elements from both input tuples.
 *
 * Examples:
 * tupleIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * tupleIntersection(listOf("apple", "banana", "orange"), listOf("banana", "grape", "kiwi")) // ["banana"]
 */
fun tupleIntersection(t1: List<Any>, t2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()

    // Iterate over each element in the first tuple
    for (element in t1) {
        // Check if the element is also present in the second tuple
        if (element in t2) {
            // Add the common element to the intersection list
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * This function takes two tuples and returns a new tuple containing the elements that are common to both tuples.
 *
 * @param t1 A tuple containing multiple elements.
 * @param t2 A tuple containing multiple elements.
 * @return A new tuple containing the common elements from both input tuples.
 *
 * Examples:
 * tupleIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * tupleIntersection(listOf("apple", "banana", "orange"), listOf("banana", "grape", "kiwi")) // ["banana"]
 */
fun tupleIntersection(t1: List<Any>, t2: List<Any>): List<Any> {
/**
 * This function takes two tuples and returns a new tuple containing the elements that are common to both tuples.
 *
 * @param t1 A tuple containing multiple elements.
 * @param t2 A tuple containing multiple elements.
 * @return A new tuple containing the common elements from both input tuples.
 *
 * Examples:
 * tupleIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * tupleIntersection(listOf("apple", "banana", "orange"), listOf("banana", "grape", "kiwi")) // ["banana"]
 */
fun tupleIntersection(t1: List<Any>, t2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()

    // Iterate over each element in the first tuple
    for (element in t1) {
        // Check if the element is also present in the second tuple
        if (element in t2) {
            // Add the common element to the intersection list
            intersection.add(element)
        }
    }

    return intersection
}