/**
 * Given two sets, return their intersection as a new set.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return The intersection of the two input sets.
 */
fun intersectionOfSets(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Iterate over each element in set1
    for (element in set1) {
        // Check if the element is also in set2
        if (element in set2) {
            // Add the element to the intersection set
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * Given two sets, return their intersection as a new set.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return The intersection of the two input sets.
 */
fun intersectionOfSets(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, return their intersection as a new set.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return The intersection of the two input sets.
 */
fun intersectionOfSets(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Iterate over each element in set1
    for (element in set1) {
        // Check if the element is also in set2
        if (element in set2) {
            // Add the element to the intersection set
            intersection.add(element)
        }
    }

    return intersection
}