/**
 * This function takes in two sets and returns a new set containing only the elements that are common
 * to both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A new set containing the common elements of set1 and set2.
 */
fun filterCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Loop through each element in set1
    for (element in set1) {
        // Use the 'in' operator to determine if the element exists in set2
        if (element in set2) {
            // Add the element to the commonElements set
            commonElements.add(element)
        }
    }

    // Return the commonElements set
    return commonElements
}
/**
 * This function takes in two sets and returns a new set containing only the elements that are common
 * to both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A new set containing the common elements of set1 and set2.
 */
fun filterCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * This function takes in two sets and returns a new set containing only the elements that are common
 * to both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A new set containing the common elements of set1 and set2.
 */
fun filterCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Loop through each element in set1
    for (element in set1) {
        // Use the 'in' operator to determine if the element exists in set2
        if (element in set2) {
            // Add the element to the commonElements set
            commonElements.add(element)
        }
    }

    // Return the commonElements set
    return commonElements
}