/**
 * Given two sets, find their intersection and union.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A Pair containing the intersection and union of the two sets.
 *
 * Example:
 * intersectionUnion(setOf(1, 2, 3), setOf(2, 3, 4)) => Pair(setOf(2, 3), setOf(1, 2, 3, 4))
 */
fun intersectionUnion(set1: Set<Int>, set2: Set<Int>): Pair<Set<Int>, Set<Int>> {

    val intersection = set1.intersect(set2)
    val union = set1.union(set2)
    return Pair(intersection, union)
}
/**
 * Given two sets, find their intersection and union.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A Pair containing the intersection and union of the two sets.
 *
 * Example:
 * intersectionUnion(setOf(1, 2, 3), setOf(2, 3, 4)) => Pair(setOf(2, 3), setOf(1, 2, 3, 4))
 */
fun intersectionUnion(set1: Set<Int>, set2: Set<Int>): Pair<Set<Int>, Set<Int>> {
/**
 * Given two sets, find their intersection and union.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return A Pair containing the intersection and union of the two sets.
 *
 * Example:
 * intersectionUnion(setOf(1, 2, 3), setOf(2, 3, 4)) => Pair(setOf(2, 3), setOf(1, 2, 3, 4))
 */
fun intersectionUnion(set1: Set<Int>, set2: Set<Int>): Pair<Set<Int>, Set<Int>> {

    val intersection = set1.intersect(set2)
    val union = set1.union(set2)
    return Pair(intersection, union)
}