/**
 * Given two sets, count the number of common elements between the sets using nested loops and sequential statements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The number of common elements between the sets.
 */
fun countCommonElements(set1: Set<Any>, set2: Set<Any>): Int {

    // Initialize count to keep track of common elements
    var count = 0

    // Iterate through each element in the first set
    for (elem1 in set1) {
        // Iterate through each element in the second set
        for (elem2 in set2) {
            // Check if the elements are equal
            if (elem1 == elem2) {
                // Increment count if the elements are equal
                count++
            }
        }
    }

    return count
}
/**
 * Given two sets, count the number of common elements between the sets using nested loops and sequential statements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The number of common elements between the sets.
 */
fun countCommonElements(set1: Set<Any>, set2: Set<Any>): Int {
/**
 * Given two sets, count the number of common elements between the sets using nested loops and sequential statements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The number of common elements between the sets.
 */
fun countCommonElements(set1: Set<Any>, set2: Set<Any>): Int {

    // Initialize count to keep track of common elements
    var count = 0

    // Iterate through each element in the first set
    for (elem1 in set1) {
        // Iterate through each element in the second set
        for (elem2 in set2) {
            // Check if the elements are equal
            if (elem1 == elem2) {
                // Increment count if the elements are equal
                count++
            }
        }
    }

    return count
}