/**
 * This exercise requires to take two sets, find the intersection of their elements,
 * and add each element of the intersection using nested loops.
 */
fun addIntersectionElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    // Initialize an empty set to store the intersection
    val intersection = mutableSetOf<Int>()
    
    // Find the intersection of the two given sets
    for (element1 in set1) {
        for (element2 in set2) {
            if (element1 == element2) {
                intersection.add(element1)
            }
        }
    }
    
    // Iterate over the intersection and add each element to a new set
    val resultSet = mutableSetOf<Int>()
    
    for (element in intersection) {
        // TODO: Complete the code to add each element to the resultSet using a nested loop
    }
    
    return resultSet
}
/**
 * This exercise requires to take two sets, find the intersection of their elements,
 * and add each element of the intersection using nested loops.
 */
fun addIntersectionElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * This exercise requires to take two sets, find the intersection of their elements,
 * and add each element of the intersection using nested loops.
 */
fun addIntersectionElements(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    // Initialize an empty set to store the intersection
    val intersection = mutableSetOf<Int>()
    
    // Find the intersection of the two given sets
    for (element1 in set1) {
        for (element2 in set2) {
            if (element1 == element2) {
                intersection.add(element1)
            }
        }
    }
    
    // Iterate over the intersection and add each element to a new set
    val resultSet = mutableSetOf<Int>()
    
    for (element in intersection) {
        // TODO: Complete the code to add each element to the resultSet using a nested loop
    }
    
    return resultSet
}