/**
 * Given two sets, find and return their common elements.
 * If there are no common elements, return null.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements, or null if there are no common elements.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any>? {

    val commonElements = mutableSetOf<Any>()
    
    // Iterate over the first set
    for (element in set1) {
        // Check if the element is present in both sets
        if (element in set2) {
            commonElements.add(element)
        }
    }
    
    if (commonElements.isEmpty()) {
        return null
    }
    
    return commonElements
}
/**
 * Given two sets, find and return their common elements.
 * If there are no common elements, return null.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements, or null if there are no common elements.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any>? {
/**
 * Given two sets, find and return their common elements.
 * If there are no common elements, return null.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A set containing the common elements, or null if there are no common elements.
 */
fun findCommonElements(set1: Set<Any>, set2: Set<Any>): Set<Any>? {

    val commonElements = mutableSetOf<Any>()
    
    // Iterate over the first set
    for (element in set1) {
        // Check if the element is present in both sets
        if (element in set2) {
            commonElements.add(element)
        }
    }
    
    if (commonElements.isEmpty()) {
        return null
    }
    
    return commonElements
}