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

    val intersectionSet = mutableSetOf<Any>()

    for (elem in set1) {
        if (elem in set2) {
            intersectionSet.add(elem)
        }
    }

    return intersectionSet
}
/**
 * Given two sets, return their intersection as a new set.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return Intersection of set1 and set2.
 */
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 Intersection of set1 and set2.
 */
fun intersectionOfSets(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val intersectionSet = mutableSetOf<Any>()

    for (elem in set1) {
        if (elem in set2) {
            intersectionSet.add(elem)
        }
    }

    return intersectionSet
}