/**
 * This exercise aims to test your understanding of operations on sets and how inclusive and exclusive range works.
 * You need to complete the code below to find the intersection of two sets, set1 and set2.
 *
 * @param set1 A set of unique elements (e.g., set1 = setOf(1, 2, 3, 4))
 * @param set2 Another set of unique elements (e.g., set2 = setOf(3, 4, 5, 6))
 * @return A set containing the common elements present in both set1 and set2.
 */
fun intersectionOfSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {

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

    // Iterate over the elements in set1
    for (element in set1) {
        // Check if the element is also present in set2
        if (element in set2) {
            // Add the element to the intersection set
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * This exercise aims to test your understanding of operations on sets and how inclusive and exclusive range works.
 * You need to complete the code below to find the intersection of two sets, set1 and set2.
 *
 * @param set1 A set of unique elements (e.g., set1 = setOf(1, 2, 3, 4))
 * @param set2 Another set of unique elements (e.g., set2 = setOf(3, 4, 5, 6))
 * @return A set containing the common elements present in both set1 and set2.
 */
fun intersectionOfSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * This exercise aims to test your understanding of operations on sets and how inclusive and exclusive range works.
 * You need to complete the code below to find the intersection of two sets, set1 and set2.
 *
 * @param set1 A set of unique elements (e.g., set1 = setOf(1, 2, 3, 4))
 * @param set2 Another set of unique elements (e.g., set2 = setOf(3, 4, 5, 6))
 * @return A set containing the common elements present in both set1 and set2.
 */
fun intersectionOfSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {

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

    // Iterate over the elements in set1
    for (element in set1) {
        // Check if the element is also present in set2
        if (element in set2) {
            // Add the element to the intersection set
            intersection.add(element)
        }
    }

    return intersection
}