/**
 * Given three sets, return a new set containing elements that are common to all three sets.
 * If there are no common elements, return an empty set.
 *
 * @param set1 First set
 * @param set2 Second set
 * @param set3 Third set
 * @return A new set containing common elements of all three sets, or an empty set if no common elements found.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): Set<Any> {

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

    // Iterate over all elements in set1
    for (element in set1) {
        if (element in set2 && element in set3) {
            // Add the element to the commonElements set if it exists in all three sets
            commonElements.add(element)
            if (commonElements.size > 10) {
                // Add a break statement to terminate the loop once more than 10 common elements are found
                break
            }
        }
    }

    // Return the set of common elements
    return commonElements
}
/**
 * Given three sets, return a new set containing elements that are common to all three sets.
 * If there are no common elements, return an empty set.
 *
 * @param set1 First set
 * @param set2 Second set
 * @param set3 Third set
 * @return A new set containing common elements of all three sets, or an empty set if no common elements found.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): Set<Any> {
/**
 * Given three sets, return a new set containing elements that are common to all three sets.
 * If there are no common elements, return an empty set.
 *
 * @param set1 First set
 * @param set2 Second set
 * @param set3 Third set
 * @return A new set containing common elements of all three sets, or an empty set if no common elements found.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>, set3: Set<Any>): Set<Any> {

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

    // Iterate over all elements in set1
    for (element in set1) {
        if (element in set2 && element in set3) {
            // Add the element to the commonElements set if it exists in all three sets
            commonElements.add(element)
            if (commonElements.size > 10) {
                // Add a break statement to terminate the loop once more than 10 common elements are found
                break
            }
        }
    }

    // Return the set of common elements
    return commonElements
}