/**
 * You are an archaeologist who has discovered two sets of artifacts. Your task is to find the common elements in
 * both sets.
 *
 * @param set1 The first set of artifacts.
 * @param set2 The second set of artifacts.
 * @return A set containing the common elements found in both sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val commonElements = mutableSetOf<Any>()
    val mutableSet1 = set1.toMutableSet()

    while (mutableSet1.isNotEmpty()) {
        val item = mutableSet1.first()
        mutableSet1.remove(item)
        if (item in set2) {
            commonElements.add(item)
        }
    }

    return commonElements
}
/**
 * You are an archaeologist who has discovered two sets of artifacts. Your task is to find the common elements in
 * both sets.
 *
 * @param set1 The first set of artifacts.
 * @param set2 The second set of artifacts.
 * @return A set containing the common elements found in both sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * You are an archaeologist who has discovered two sets of artifacts. Your task is to find the common elements in
 * both sets.
 *
 * @param set1 The first set of artifacts.
 * @param set2 The second set of artifacts.
 * @return A set containing the common elements found in both sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val commonElements = mutableSetOf<Any>()
    val mutableSet1 = set1.toMutableSet()

    while (mutableSet1.isNotEmpty()) {
        val item = mutableSet1.first()
        mutableSet1.remove(item)
        if (item in set2) {
            commonElements.add(item)
        }
    }

    return commonElements
}