/**
 * Given two sets, returns a set containing the common elements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements between set1 and set2.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val commonElements = mutableSetOf<Any>()  // Initialize an empty set
    // Nested for loop to iterate over each combination of elements in set1 and set2
    for (element1 in set1) {
        for (element2 in set2) {
            if (element1 == element2) {  // If element1 and element2 are equal
                commonElements.add(element1)  // Add the element to the commonElements set
            }
        }
    }
    return commonElements
}
/**
 * Given two sets, returns a set containing the common elements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements between set1 and set2.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, returns a set containing the common elements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements between set1 and set2.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val commonElements = mutableSetOf<Any>()  // Initialize an empty set
    // Nested for loop to iterate over each combination of elements in set1 and set2
    for (element1 in set1) {
        for (element2 in set2) {
            if (element1 == element2) {  // If element1 and element2 are equal
                commonElements.add(element1)  // Add the element to the commonElements set
            }
        }
    }
    return commonElements
}