/**
 * This function takes two sets as input and returns the intersection of the two sets using set comprehension.
 *
 * @param set1 First input set.
 * @param set2 Second input set.
 * @return Intersection of the two input sets.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * intersectionUsingSetComprehension(set1, set2) // Output: setOf(4, 5)
 */
fun intersectionUsingSetComprehension(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    // Find the intersection using set comprehension
    val intersectionSet = set1.filter { it in set2 }.toSet()
    return intersectionSet
}
/**
 * This function takes two sets as input and returns the intersection of the two sets using set comprehension.
 *
 * @param set1 First input set.
 * @param set2 Second input set.
 * @return Intersection of the two input sets.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * intersectionUsingSetComprehension(set1, set2) // Output: setOf(4, 5)
 */
fun intersectionUsingSetComprehension(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * This function takes two sets as input and returns the intersection of the two sets using set comprehension.
 *
 * @param set1 First input set.
 * @param set2 Second input set.
 * @return Intersection of the two input sets.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * intersectionUsingSetComprehension(set1, set2) // Output: setOf(4, 5)
 */
fun intersectionUsingSetComprehension(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    // Find the intersection using set comprehension
    val intersectionSet = set1.filter { it in set2 }.toSet()
    return intersectionSet
}