/**
 * This function takes two sets as input and returns a list of elements that are common in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A list of common elements between set1 and set2.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3), setOf(2, 3, 4)) // [2, 3]
 * findCommonElements(setOf("apple", "orange", "banana"), setOf("banana", "pear", "kiwi")) // ["banana"]
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

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

    return commonElements
}
/**
 * This function takes two sets as input and returns a list of elements that are common in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A list of common elements between set1 and set2.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3), setOf(2, 3, 4)) // [2, 3]
 * findCommonElements(setOf("apple", "orange", "banana"), setOf("banana", "pear", "kiwi")) // ["banana"]
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): List<Any> {
/**
 * This function takes two sets as input and returns a list of elements that are common in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A list of common elements between set1 and set2.
 *
 * Example:
 * findCommonElements(setOf(1, 2, 3), setOf(2, 3, 4)) // [2, 3]
 * findCommonElements(setOf("apple", "orange", "banana"), setOf("banana", "pear", "kiwi")) // ["banana"]
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

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

    return commonElements
}