/**
 * Given two sets, returns a new set containing the elements that are in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the intersection of set1 and set2.
 */
fun indexSetIntersection(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val intersectionSet = mutableSetOf<Any>()

    // Iterate through set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the common element to the intersection set
            intersectionSet.add(element)
        }
    }

    return intersectionSet
}
/**
 * Given two sets, returns a new set containing the elements that are in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the intersection of set1 and set2.
 */
fun indexSetIntersection(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, returns a new set containing the elements that are in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the intersection of set1 and set2.
 */
fun indexSetIntersection(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val intersectionSet = mutableSetOf<Any>()

    // Iterate through set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the common element to the intersection set
            intersectionSet.add(element)
        }
    }

    return intersectionSet
}