/**
 * Takes two sets as input and returns the intersection of the two sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The intersection of the two sets.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * println(intersectionOfSets(set1, set2)) // Output: [4, 5]
 * '``
 */
fun intersectionOfSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    if (set1.isEmpty() || set2.isEmpty()) {
        return emptySet()
    }
    return set1.intersect(set2)
}
/**
 * Takes two sets as input and returns the intersection of the two sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The intersection of the two sets.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * println(intersectionOfSets(set1, set2)) // Output: [4, 5]
 * '``
 */
fun intersectionOfSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Takes two sets as input and returns the intersection of the two sets.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The intersection of the two sets.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * println(intersectionOfSets(set1, set2)) // Output: [4, 5]
 * '``
 */
fun intersectionOfSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    if (set1.isEmpty() || set2.isEmpty()) {
        return emptySet()
    }
    return set1.intersect(set2)
}