/**
 * Given two tuples, create a set containing the elements present at the intersection of their indices.
 */
fun createSetFromTupleIndices(tuple1: List<Any>, tuple2: List<Any>): Set<Any> {

    // Initialize an empty set to store the common elements
    val commonElements = mutableSetOf<Any>()

    // Iterate over the indices of the first tuple
    for (i in tuple1.indices) {
        try {
            // Check if the corresponding index in the second tuple is within its range
            if (tuple2.getOrNull(i) == tuple1[i]) {
                // Add the element at the intersection of indices to the set
                commonElements.add(tuple1[i])
            }
        } catch (e: IndexOutOfBoundsException) {
            // If the index is out of range for the second tuple, break the loop
            break
        }
    }

    // Return the set containing the common elements
    return commonElements
}
/**
 * Given two tuples, create a set containing the elements present at the intersection of their indices.
 */
fun createSetFromTupleIndices(tuple1: List<Any>, tuple2: List<Any>): Set<Any> {
/**
 * Given two tuples, create a set containing the elements present at the intersection of their indices.
 */
fun createSetFromTupleIndices(tuple1: List<Any>, tuple2: List<Any>): Set<Any> {

    // Initialize an empty set to store the common elements
    val commonElements = mutableSetOf<Any>()

    // Iterate over the indices of the first tuple
    for (i in tuple1.indices) {
        try {
            // Check if the corresponding index in the second tuple is within its range
            if (tuple2.getOrNull(i) == tuple1[i]) {
                // Add the element at the intersection of indices to the set
                commonElements.add(tuple1[i])
            }
        } catch (e: IndexOutOfBoundsException) {
            // If the index is out of range for the second tuple, break the loop
            break
        }
    }

    // Return the set containing the common elements
    return commonElements
}