/**
 * This function takes in two tuples and returns their intersection.
 * The intersection of two tuples is a new tuple that contains elements common to both tuples.
 */
fun intersectionOfTuples(tup1: List<Any>, tup2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()  // Initialize an empty list for the intersection elements
    
    for (elem1 in tup1) {  // Loop through each element in the first tuple
        for (elem2 in tup2) {  // Loop through each element in the second tuple
            if (elem1 == elem2) {  // Check if the elements are equal
                intersection.add(elem1)  // Add the common element to the intersection list
            }
        }
    }
    
    return intersection
}
/**
 * This function takes in two tuples and returns their intersection.
 * The intersection of two tuples is a new tuple that contains elements common to both tuples.
 */
fun intersectionOfTuples(tup1: List<Any>, tup2: List<Any>): List<Any> {
/**
 * This function takes in two tuples and returns their intersection.
 * The intersection of two tuples is a new tuple that contains elements common to both tuples.
 */
fun intersectionOfTuples(tup1: List<Any>, tup2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()  // Initialize an empty list for the intersection elements
    
    for (elem1 in tup1) {  // Loop through each element in the first tuple
        for (elem2 in tup2) {  // Loop through each element in the second tuple
            if (elem1 == elem2) {  // Check if the elements are equal
                intersection.add(elem1)  // Add the common element to the intersection list
            }
        }
    }
    
    return intersection
}