/**
 * Given two sets, find the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set of common elements between set1 and set2.
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

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

    // Iterate over the elements of set1
    for (element in set1) {
        // Iterate over the elements of set2
        for (item in set2) {
            // Check if the current element in set1 is equal to the current item in set2
            if (element == item) {
                // Add the common element to the set of common elements
                commonElements.add(element)
                // Break out of the inner loop
                break
            }
            // Continue to the next iteration of the inner loop if the current element is greater than the current item
            else if (element > item) {
                continue
            }
            // Break out of the inner loop if the current element is smaller than the current item
            else {
                break
            }
        }
    }

    return commonElements
}
/**
 * Given two sets, find the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set of common elements between set1 and set2.
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Given two sets, find the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set of common elements between set1 and set2.
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

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

    // Iterate over the elements of set1
    for (element in set1) {
        // Iterate over the elements of set2
        for (item in set2) {
            // Check if the current element in set1 is equal to the current item in set2
            if (element == item) {
                // Add the common element to the set of common elements
                commonElements.add(element)
                // Break out of the inner loop
                break
            }
            // Continue to the next iteration of the inner loop if the current element is greater than the current item
            else if (element > item) {
                continue
            }
            // Break out of the inner loop if the current element is smaller than the current item
            else {
                break
            }
        }
    }

    return commonElements
}