/**
 * This function is designed to find the common elements present in all three sets: set1, set2, and set3.
 *
 * @param set1 The first set containing elements.
 * @param set2 The second set containing elements.
 * @param set3 The third set containing elements.
 * @return A set containing the common elements present in all three sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): Set<Any> {

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

    for (item1 in set1) {  // Iterating through each item in set1
        for (item2 in set2) {  // Iterating through each item in set2
            for (item3 in set3) {  // Iterating through each item in set3
                if (item1 == item2 || item1 == item3 || item2 == item3) {  // Checking if any two items are equal
                    commonElements.add(item1)  // Adding the common element to the set
                }
            }
        }
    }

    return commonElements
}
/**
 * This function is designed to find the common elements present in all three sets: set1, set2, and set3.
 *
 * @param set1 The first set containing elements.
 * @param set2 The second set containing elements.
 * @param set3 The third set containing elements.
 * @return A set containing the common elements present in all three sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): Set<Any> {
/**
 * This function is designed to find the common elements present in all three sets: set1, set2, and set3.
 *
 * @param set1 The first set containing elements.
 * @param set2 The second set containing elements.
 * @param set3 The third set containing elements.
 * @return A set containing the common elements present in all three sets.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): Set<Any> {

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

    for (item1 in set1) {  // Iterating through each item in set1
        for (item2 in set2) {  // Iterating through each item in set2
            for (item3 in set3) {  // Iterating through each item in set3
                if (item1 == item2 || item1 == item3 || item2 == item3) {  // Checking if any two items are equal
                    commonElements.add(item1)  // Adding the common element to the set
                }
            }
        }
    }

    return commonElements
}