/**
 * This exercise requires the implementation of a function that counts the number of elements
 * that are common to both given sets.
 *
 * @param set1 The first set of elements
 * @param set2 The second set of elements
 * @return The count of common elements between set1 and set2
 */
fun countIntersectionOfSets(set1: Set<Any>, set2: Set<Any>): Int {

    // Convert the sets to lists
    val list1 = set1.toList()
    val list2 = set2.toList()

    // Initialize a counter to keep track of common elements
    var commonElements = 0

    // Iterate through the elements of set1
    for (element in list1) {
        if (element in list2) {
            commonElements++
        }
    }

    // Return the count of common elements
    return commonElements
}
/**
 * This exercise requires the implementation of a function that counts the number of elements
 * that are common to both given sets.
 *
 * @param set1 The first set of elements
 * @param set2 The second set of elements
 * @return The count of common elements between set1 and set2
 */
fun countIntersectionOfSets(set1: Set<Any>, set2: Set<Any>): Int {
/**
 * This exercise requires the implementation of a function that counts the number of elements
 * that are common to both given sets.
 *
 * @param set1 The first set of elements
 * @param set2 The second set of elements
 * @return The count of common elements between set1 and set2
 */
fun countIntersectionOfSets(set1: Set<Any>, set2: Set<Any>): Int {

    // Convert the sets to lists
    val list1 = set1.toList()
    val list2 = set2.toList()

    // Initialize a counter to keep track of common elements
    var commonElements = 0

    // Iterate through the elements of set1
    for (element in list1) {
        if (element in list2) {
            commonElements++
        }
    }

    // Return the count of common elements
    return commonElements
}