/**
 * This exercise aims to practice the intersection operation using set comprehension in Python.
 * Given two lists, find the common numbers between them by subtracting one list from another
 * using set comprehension.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A set containing the common numbers found between the two lists.
 *
 * Example:
 * findCommonNumbers(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Output: setOf(4, 5)
 * findCommonNumbers(listOf(10, 20, 30), listOf(40, 50, 60)) // Output: emptySet()
 */
fun findCommonNumbers(list1: List<Int>, list2: List<Int>): Set<Int> {

    return list1.filter { it in list2 }.toSet() - list2.filter { it in list1 }.toSet()
}
/**
 * This exercise aims to practice the intersection operation using set comprehension in Python.
 * Given two lists, find the common numbers between them by subtracting one list from another
 * using set comprehension.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A set containing the common numbers found between the two lists.
 *
 * Example:
 * findCommonNumbers(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Output: setOf(4, 5)
 * findCommonNumbers(listOf(10, 20, 30), listOf(40, 50, 60)) // Output: emptySet()
 */
fun findCommonNumbers(list1: List<Int>, list2: List<Int>): Set<Int> {
/**
 * This exercise aims to practice the intersection operation using set comprehension in Python.
 * Given two lists, find the common numbers between them by subtracting one list from another
 * using set comprehension.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A set containing the common numbers found between the two lists.
 *
 * Example:
 * findCommonNumbers(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Output: setOf(4, 5)
 * findCommonNumbers(listOf(10, 20, 30), listOf(40, 50, 60)) // Output: emptySet()
 */
fun findCommonNumbers(list1: List<Int>, list2: List<Int>): Set<Int> {

    return list1.filter { it in list2 }.toSet() - list2.filter { it in list1 }.toSet()
}