/**
 * Given two sets, find the common elements between them and return a new set.
 *
 * @param set1 First input set.
 * @param set2 Second input set.
 * @return A set containing the common elements between the two input sets.
 */
fun calculateCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    for (element1 in set1) {  // Iterate over each element in set1
        for (element2 in set2) {  // Iterate over each element in set2
            if (element1 == element2) {
                commonElements.add(element1)  // Add the common element to the set
            }
        }
    }

    return commonElements
}
/**
 * Given two sets, find the common elements between them and return a new set.
 *
 * @param set1 First input set.
 * @param set2 Second input set.
 * @return A set containing the common elements between the two input sets.
 */
fun calculateCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, find the common elements between them and return a new set.
 *
 * @param set1 First input set.
 * @param set2 Second input set.
 * @return A set containing the common elements between the two input sets.
 */
fun calculateCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    for (element1 in set1) {  // Iterate over each element in set1
        for (element2 in set2) {  // Iterate over each element in set2
            if (element1 == element2) {
                commonElements.add(element1)  // Add the common element to the set
            }
        }
    }

    return commonElements
}