/**
 * Given two sets, return a tuple containing the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A tuple containing the common elements between set1 and set2.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: (3, 4)
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    
    // Iterate through each element in set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the common element to the list
            commonElements.add(element)
        }
    }
    
    return commonElements
}
/**
 * Given two sets, return a tuple containing the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A tuple containing the common elements between set1 and set2.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: (3, 4)
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): List<Int> {
/**
 * Given two sets, return a tuple containing the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A tuple containing the common elements between set1 and set2.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: (3, 4)
 */
fun findCommonElements(set1: Set<Int>, set2: Set<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()
    
    // Iterate through each element in set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the common element to the list
            commonElements.add(element)
        }
    }
    
    return commonElements
}