/**
 * Write a function that takes in two sets and returns a list of all the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A list of common elements between set1 and set2.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(3, 4, 5, 6, 7)
 * getCommonElements(set1, set2) -> [3, 4, 5]
 */
fun getCommonElements(set1: Set<Int>, set2: Set<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate through set1
    for (element in set1) {
        // Check if the element is also in set2
        if (element in set2) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Write a function that takes in two sets and returns a list of all the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A list of common elements between set1 and set2.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(3, 4, 5, 6, 7)
 * getCommonElements(set1, set2) -> [3, 4, 5]
 */
fun getCommonElements(set1: Set<Int>, set2: Set<Int>): List<Int> {
/**
 * Write a function that takes in two sets and returns a list of all the common elements between them.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A list of common elements between set1 and set2.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(3, 4, 5, 6, 7)
 * getCommonElements(set1, set2) -> [3, 4, 5]
 */
fun getCommonElements(set1: Set<Int>, set2: Set<Int>): List<Int> {

    val commonElements = mutableListOf<Int>()

    // Iterate through set1
    for (element in set1) {
        // Check if the element is also in set2
        if (element in set2) {
            commonElements.add(element)
        }
    }

    return commonElements
}