/**
 * This function takes a list of tuples as input and returns a list containing the intersection of the tuples.
 *
 * @param tuples A list of tuples
 * @return A list of elements that are present in all the tuples
 */
fun findIntersection(tuples: List<List<Any>>): List<Any> {

    val commonElements = mutableListOf<Any>()
    var counter = 0

    // Iterate through each element in the first tuple of the list
    for (element in tuples[0]) {
        // Iterate through each tuple in the list
        for ((i, tuple) in tuples.withIndex()) {
            // Check if the element exists in the current tuple
            if (element !in tuple) {
                break
            }

            // If the element is present in all tuples, increase the counter
            if (i == tuples.size - 1) {
                counter++

                // Check if the element is not already present in the commonElements list
                if (element !in commonElements) {
                    commonElements.add(element)
                }
            }
        }
    }

    // Return the list of common elements
    return commonElements
}
/**
 * This function takes a list of tuples as input and returns a list containing the intersection of the tuples.
 *
 * @param tuples A list of tuples
 * @return A list of elements that are present in all the tuples
 */
fun findIntersection(tuples: List<List<Any>>): List<Any> {
/**
 * This function takes a list of tuples as input and returns a list containing the intersection of the tuples.
 *
 * @param tuples A list of tuples
 * @return A list of elements that are present in all the tuples
 */
fun findIntersection(tuples: List<List<Any>>): List<Any> {

    val commonElements = mutableListOf<Any>()
    var counter = 0

    // Iterate through each element in the first tuple of the list
    for (element in tuples[0]) {
        // Iterate through each tuple in the list
        for ((i, tuple) in tuples.withIndex()) {
            // Check if the element exists in the current tuple
            if (element !in tuple) {
                break
            }

            // If the element is present in all tuples, increase the counter
            if (i == tuples.size - 1) {
                counter++

                // Check if the element is not already present in the commonElements list
                if (element !in commonElements) {
                    commonElements.add(element)
                }
            }
        }
    }

    // Return the list of common elements
    return commonElements
}