/**
 * Given two sets, find and return their common elements.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return Set containing the common elements found in both sets.
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()  // Create a mutable set to store the common elements

    for (element1 in set1) {  // Iterate over the elements of set1
        for (element2 in set2) {  // Iterate over the elements of set2
            if (element1 == element2) {  // If an element is found in both sets
                commonElements.add(element1)  // Add the common element to the set
            }
        }
    }

    return commonElements
}
/**
 * Given two sets, find and return their common elements.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return Set containing the common elements found in both sets.
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Given two sets, find and return their common elements.
 *
 * @param set1 First set.
 * @param set2 Second set.
 * @return Set containing the common elements found in both sets.
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()  // Create a mutable set to store the common elements

    for (element1 in set1) {  // Iterate over the elements of set1
        for (element2 in set2) {  // Iterate over the elements of set2
            if (element1 == element2) {  // If an element is found in both sets
                commonElements.add(element1)  // Add the common element to the set
            }
        }
    }

    return commonElements
}