/**
 * Given two sets, find and return the common elements in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements in both sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Iterate through each element in set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the element to the commonElements set
            commonElements.add(element)
        }
    }

    // Return the set containing the common elements
    return commonElements.toSet()
}
/**
 * Given two sets, find and return the common elements in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements in both sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, find and return the common elements in both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements in both sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

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

    // Iterate through each element in set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the element to the commonElements set
            commonElements.add(element)
        }
    }

    // Return the set containing the common elements
    return commonElements.toSet()
}