/**
 * Given two sets of positive integers, find the intersection of the two sets using loops.
 *
 * @param set1 First set of positive integers.
 * @param set2 Second set of positive integers.
 * @return Intersection of the two sets.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, 4, 5, 6)
 * val set2 = setOf(4, 5, 6, 7, 8, 9)
 * println(intersectionOfLoopsWithPositiveIntegers(set1, set2)) // Output: [4, 5, 6]
 * '``
 */
fun intersectionOfLoopsWithPositiveIntegers(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val intersectionSet = mutableSetOf<Int>()

    for (num1 in set1) {
        for (num2 in set2) {
            if (num1 == num2) {
                intersectionSet.add(num1)
            }
        }
    }

    return intersectionSet
}
/**
 * Given two sets of positive integers, find the intersection of the two sets using loops.
 *
 * @param set1 First set of positive integers.
 * @param set2 Second set of positive integers.
 * @return Intersection of the two sets.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, 4, 5, 6)
 * val set2 = setOf(4, 5, 6, 7, 8, 9)
 * println(intersectionOfLoopsWithPositiveIntegers(set1, set2)) // Output: [4, 5, 6]
 * '``
 */
fun intersectionOfLoopsWithPositiveIntegers(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Given two sets of positive integers, find the intersection of the two sets using loops.
 *
 * @param set1 First set of positive integers.
 * @param set2 Second set of positive integers.
 * @return Intersection of the two sets.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, 4, 5, 6)
 * val set2 = setOf(4, 5, 6, 7, 8, 9)
 * println(intersectionOfLoopsWithPositiveIntegers(set1, set2)) // Output: [4, 5, 6]
 * '``
 */
fun intersectionOfLoopsWithPositiveIntegers(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val intersectionSet = mutableSetOf<Int>()

    for (num1 in set1) {
        for (num2 in set2) {
            if (num1 == num2) {
                intersectionSet.add(num1)
            }
        }
    }

    return intersectionSet
}