/**
 * This function takes in two sets and returns a new set containing the common elements between the two sets.
 *
 * @param set1 First set
 * @param set2 Second set
 * @return New set containing common elements
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4)
 * val set2 = setOf(3, 4, 5, 6)
 * findCommonElements(set1, set2) -> setOf(3, 4)
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()

    for (element in set1) {
        if (element in set2) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * This function takes in two sets and returns a new set containing the common elements between the two sets.
 *
 * @param set1 First set
 * @param set2 Second set
 * @return New set containing common elements
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4)
 * val set2 = setOf(3, 4, 5, 6)
 * findCommonElements(set1, set2) -> setOf(3, 4)
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * This function takes in two sets and returns a new set containing the common elements between the two sets.
 *
 * @param set1 First set
 * @param set2 Second set
 * @return New set containing common elements
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4)
 * val set2 = setOf(3, 4, 5, 6)
 * findCommonElements(set1, set2) -> setOf(3, 4)
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()

    for (element in set1) {
        if (element in set2) {
            commonElements.add(element)
        }
    }

    return commonElements
}