/**
 * Given two sets, return the intersection of the sets where elements in set1 are less than
 * elements in set2. The returned set will only contain elements from set1 that are less
 * than all elements in set2.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return A set containing elements that are less than all elements in set2.
 *
 * Example:
 * set1 = setOf(4, 8, 12, 16)
 * set2 = setOf(10, 15, 20, 25)
 * intersectionLessThan(set1, set2) -> setOf(4, 8)
 */
fun intersectionLessThan(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()
    for (elem in set1) {
        if (set2.all { elem < it }) {
            commonElements.add(elem)
        }
    }
    return commonElements
}
/**
 * Given two sets, return the intersection of the sets where elements in set1 are less than
 * elements in set2. The returned set will only contain elements from set1 that are less
 * than all elements in set2.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return A set containing elements that are less than all elements in set2.
 *
 * Example:
 * set1 = setOf(4, 8, 12, 16)
 * set2 = setOf(10, 15, 20, 25)
 * intersectionLessThan(set1, set2) -> setOf(4, 8)
 */
fun intersectionLessThan(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * Given two sets, return the intersection of the sets where elements in set1 are less than
 * elements in set2. The returned set will only contain elements from set1 that are less
 * than all elements in set2.
 *
 * @param set1 A set of elements
 * @param set2 Another set of elements
 * @return A set containing elements that are less than all elements in set2.
 *
 * Example:
 * set1 = setOf(4, 8, 12, 16)
 * set2 = setOf(10, 15, 20, 25)
 * intersectionLessThan(set1, set2) -> setOf(4, 8)
 */
fun intersectionLessThan(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    val commonElements = mutableSetOf<Int>()
    for (elem in set1) {
        if (set2.all { elem < it }) {
            commonElements.add(elem)
        }
    }
    return commonElements
}