/**
 * This exercise aims to test your understanding of looping through sets using a for loop
 * and performing operations with tuples. The goal is to find the intersection of two sets
 * and return a sorted tuple containing the common elements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return Sorted tuple containing the common elements.
 */
fun intersectionOfSetsAndTuples(set1: Set<Int>, set2: Set<Int>): List<Int> {

    val result = mutableListOf<Int>()  // To store the common elements

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

    return result.sorted()
}
/**
 * This exercise aims to test your understanding of looping through sets using a for loop
 * and performing operations with tuples. The goal is to find the intersection of two sets
 * and return a sorted tuple containing the common elements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return Sorted tuple containing the common elements.
 */
fun intersectionOfSetsAndTuples(set1: Set<Int>, set2: Set<Int>): List<Int> {
/**
 * This exercise aims to test your understanding of looping through sets using a for loop
 * and performing operations with tuples. The goal is to find the intersection of two sets
 * and return a sorted tuple containing the common elements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return Sorted tuple containing the common elements.
 */
fun intersectionOfSetsAndTuples(set1: Set<Int>, set2: Set<Int>): List<Int> {

    val result = mutableListOf<Int>()  // To store the common elements

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

    return result.sorted()
}