/**
 * Given two sets, find the intersection of elements where the elements in set1 are greater than or equal to
 * elements in set2. Return a new set containing the intersection.
 *
 * @param set1 Set containing elements for comparison
 * @param set2 Set containing elements for comparison
 * @return Set with elements representing the intersection of set1 and set2
 *
 * Example:
 * intersectionOfLoopsWithSets(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 * intersectionOfLoopsWithSets(setOf(5, 6, 7), setOf(1, 2, 3)) // Output: emptySet()
 */
fun intersectionOfLoopsWithSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val intersection = mutableSetOf<Int>()

    for (element1 in set1) {
        for (element2 in set2) {
            // Check if the element in set1 is greater than or equal to the element in set2
            if (element1 >= element2) {
                intersection.add(element1)
                break
            }
        }
    }

    return intersection
}
/**
 * Given two sets, find the intersection of elements where the elements in set1 are greater than or equal to
 * elements in set2. Return a new set containing the intersection.
 *
 * @param set1 Set containing elements for comparison
 * @param set2 Set containing elements for comparison
 * @return Set with elements representing the intersection of set1 and set2
 *
 * Example:
 * intersectionOfLoopsWithSets(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 * intersectionOfLoopsWithSets(setOf(5, 6, 7), setOf(1, 2, 3)) // Output: emptySet()
 */
fun intersectionOfLoopsWithSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Given two sets, find the intersection of elements where the elements in set1 are greater than or equal to
 * elements in set2. Return a new set containing the intersection.
 *
 * @param set1 Set containing elements for comparison
 * @param set2 Set containing elements for comparison
 * @return Set with elements representing the intersection of set1 and set2
 *
 * Example:
 * intersectionOfLoopsWithSets(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 * intersectionOfLoopsWithSets(setOf(5, 6, 7), setOf(1, 2, 3)) // Output: emptySet()
 */
fun intersectionOfLoopsWithSets(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val intersection = mutableSetOf<Int>()

    for (element1 in set1) {
        for (element2 in set2) {
            // Check if the element in set1 is greater than or equal to the element in set2
            if (element1 >= element2) {
                intersection.add(element1)
                break
            }
        }
    }

    return intersection
}