/**
 * Given two sets, find the common elements using nested for loops.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A new set containing the common elements from the input sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val commonElements = mutableSetOf<Any>()

    // Iterate through each element in set1
    for (element1 in set1) {
        // Iterate through each element in set2
        for (element2 in set2) {
            // Check if the elements are equal
            if (element1 == element2) {
                // Add the common element to the set
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}
/**
 * Given two sets, find the common elements using nested for loops.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A new set containing the common elements from the input sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {
/**
 * Given two sets, find the common elements using nested for loops.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A new set containing the common elements from the input sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any> {

    val commonElements = mutableSetOf<Any>()

    // Iterate through each element in set1
    for (element1 in set1) {
        // Iterate through each element in set2
        for (element2 in set2) {
            // Check if the elements are equal
            if (element1 == element2) {
                // Add the common element to the set
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}