/**
 * Given two sets, return a new set of elements that are common in both sets.
 *
 * @param set1 First set (contains unique elements)
 * @param set2 Second set (contains unique elements)
 * @return Set containing elements common to both sets
 */
fun intersectionCheck(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Iterate over each element in the first set
    for (element in set1) {
        // Check if the element exists in the second set
        if (element in set2) {
            // Add the element to the intersection set
            intersectionSet.add(element)
        }
    }

    // Return the final intersection set
    return intersectionSet
}
/**
 * Given two sets, return a new set of elements that are common in both sets.
 *
 * @param set1 First set (contains unique elements)
 * @param set2 Second set (contains unique elements)
 * @return Set containing elements common to both sets
 */
fun intersectionCheck(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, return a new set of elements that are common in both sets.
 *
 * @param set1 First set (contains unique elements)
 * @param set2 Second set (contains unique elements)
 * @return Set containing elements common to both sets
 */
fun intersectionCheck(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Iterate over each element in the first set
    for (element in set1) {
        // Check if the element exists in the second set
        if (element in set2) {
            // Add the element to the intersection set
            intersectionSet.add(element)
        }
    }

    // Return the final intersection set
    return intersectionSet
}