/**
 * Given two sets, return the intersection of the two sets.
 *
 * @param set1 A set of elements.
 * @param set2 Another set of elements.
 * @return The intersection of set1 and set2.
 *
 * Example:
 * operationIntersection(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 */
fun operationIntersection(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val intersection = mutableSetOf<Int>()
    for (element in set1) {
        if (element in set2) {
            intersection.add(element)
        }
    }
    return intersection
}

// Exercise
// Implement the missing code inside the operationIntersection function
// to find the intersection of set1 and set2.
// Make sure the solution works for any input set.
// Hint: You may use the 'continue' statement to skip an iteration of the loop.
/**
 * Given two sets, return the intersection of the two sets.
 *
 * @param set1 A set of elements.
 * @param set2 Another set of elements.
 * @return The intersection of set1 and set2.
 *
 * Example:
 * operationIntersection(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 */
fun operationIntersection(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Given two sets, return the intersection of the two sets.
 *
 * @param set1 A set of elements.
 * @param set2 Another set of elements.
 * @return The intersection of set1 and set2.
 *
 * Example:
 * operationIntersection(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 */
fun operationIntersection(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val intersection = mutableSetOf<Int>()
    for (element in set1) {
        if (element in set2) {
            intersection.add(element)
        }
    }
    return intersection
}

// Exercise
// Implement the missing code inside the operationIntersection function
// to find the intersection of set1 and set2.
// Make sure the solution works for any input set.
// Hint: You may use the 'continue' statement to skip an iteration of the loop.