/**
 * Given two sets, return a new set containing the common elements
 * that exist in both sets.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return A set containing the common elements between set1 and set2
 */
fun commonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    // Initialize an empty set to store the common elements
    val commonSet = mutableSetOf<Any>()

    // Loop through each element in set1
    for (element in set1) {
        // Check if the element exists in set2
        if (element in set2) {
            // Add the element to the commonSet
            commonSet.add(element)
        }
    }

    return commonSet
}
/**
 * Given two sets, return a new set containing the common elements
 * that exist in both sets.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return A set containing the common elements between set1 and set2
 */
fun commonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, return a new set containing the common elements
 * that exist in both sets.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return A set containing the common elements between set1 and set2
 */
fun commonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    // Initialize an empty set to store the common elements
    val commonSet = mutableSetOf<Any>()

    // Loop through each element in set1
    for (element in set1) {
        // Check if the element exists in set2
        if (element in set2) {
            // Add the element to the commonSet
            commonSet.add(element)
        }
    }

    return commonSet
}