/**
 * Your task is to implement a function that takes two sets as input and returns the number of elements
 * common to both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The count of elements common to both sets.
 *
 * Examples:
 * countIntersection(setOf(1, 2, 3), setOf(2, 3, 4)) // 2
 * countIntersection(setOf(7, 8, 9), setOf(1, 2, 3, 4)) // 0
 * countIntersection(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // 2
 */
fun countIntersection(set1: Set<Int>, set2: Set<Int>): Int {

    val commonElements = set1.intersect(set2)
    return commonElements.size
}
/**
 * Your task is to implement a function that takes two sets as input and returns the number of elements
 * common to both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The count of elements common to both sets.
 *
 * Examples:
 * countIntersection(setOf(1, 2, 3), setOf(2, 3, 4)) // 2
 * countIntersection(setOf(7, 8, 9), setOf(1, 2, 3, 4)) // 0
 * countIntersection(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // 2
 */
fun countIntersection(set1: Set<Int>, set2: Set<Int>): Int {
/**
 * Your task is to implement a function that takes two sets as input and returns the number of elements
 * common to both sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The count of elements common to both sets.
 *
 * Examples:
 * countIntersection(setOf(1, 2, 3), setOf(2, 3, 4)) // 2
 * countIntersection(setOf(7, 8, 9), setOf(1, 2, 3, 4)) // 0
 * countIntersection(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // 2
 */
fun countIntersection(set1: Set<Int>, set2: Set<Int>): Int {

    val commonElements = set1.intersect(set2)
    return commonElements.size
}