/**
 * Returns the intersection of two sets.
 *
 * @param setA A set with elements.
 * @param setB Another set with elements.
 * @return A set containing the common elements between the two sets.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * intersectionExampleSets(set1, set2) // Output: [4, 5]
 */
fun intersectionExampleSets(setA: Set<Int>, setB: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()

    setA.forEach { element ->
        if (element in setB) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Returns the intersection of two sets.
 *
 * @param setA A set with elements.
 * @param setB Another set with elements.
 * @return A set containing the common elements between the two sets.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * intersectionExampleSets(set1, set2) // Output: [4, 5]
 */
fun intersectionExampleSets(setA: Set<Int>, setB: Set<Int>): Set<Int> {
/**
 * Returns the intersection of two sets.
 *
 * @param setA A set with elements.
 * @param setB Another set with elements.
 * @return A set containing the common elements between the two sets.
 *
 * Example:
 * val set1 = setOf(1, 2, 3, 4, 5)
 * val set2 = setOf(4, 5, 6, 7, 8)
 * intersectionExampleSets(set1, set2) // Output: [4, 5]
 */
fun intersectionExampleSets(setA: Set<Int>, setB: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()

    setA.forEach { element ->
        if (element in setB) {
            commonElements.add(element)
        }
    }

    return commonElements
}