/**
 * This exercise focuses on nested logical operators and iterating through sets. Your task is to complete the function
 * 'countCommonElements' which takes in two sets as arguments and counts the number of common elements between them.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return The number of common elements between set1 and set2
 *
 * Instructions:
 * 1. Initialize a variable 'count' to 0.
 * 2. Iterate through the elements in set1.
 *    a. If an element is also present in set2, increment 'count' by 1.
 * 3. Return the final value of 'count'.
 *
 * Example:
 * countCommonElements(setOf(1, 2, 3), setOf(3, 4, 5)) should return 1, as 3 is the only common element between the two sets.
 */
fun countCommonElements(set1: Set<Int>, set2: Set<Int>): Int {

    var count = 0
    for (element in set1) {
        if (element in set2) {
            count++
        }
    }
    return count
}
/**
 * This exercise focuses on nested logical operators and iterating through sets. Your task is to complete the function
 * 'countCommonElements' which takes in two sets as arguments and counts the number of common elements between them.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return The number of common elements between set1 and set2
 *
 * Instructions:
 * 1. Initialize a variable 'count' to 0.
 * 2. Iterate through the elements in set1.
 *    a. If an element is also present in set2, increment 'count' by 1.
 * 3. Return the final value of 'count'.
 *
 * Example:
 * countCommonElements(setOf(1, 2, 3), setOf(3, 4, 5)) should return 1, as 3 is the only common element between the two sets.
 */
fun countCommonElements(set1: Set<Int>, set2: Set<Int>): Int {
/**
 * This exercise focuses on nested logical operators and iterating through sets. Your task is to complete the function
 * 'countCommonElements' which takes in two sets as arguments and counts the number of common elements between them.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return The number of common elements between set1 and set2
 *
 * Instructions:
 * 1. Initialize a variable 'count' to 0.
 * 2. Iterate through the elements in set1.
 *    a. If an element is also present in set2, increment 'count' by 1.
 * 3. Return the final value of 'count'.
 *
 * Example:
 * countCommonElements(setOf(1, 2, 3), setOf(3, 4, 5)) should return 1, as 3 is the only common element between the two sets.
 */
fun countCommonElements(set1: Set<Int>, set2: Set<Int>): Int {

    var count = 0
    for (element in set1) {
        if (element in set2) {
            count++
        }
    }
    return count
}