/**
 * The function takes two sets as input and adds elements from set1 to set2.
 * The function should only add elements from set1 to set2 until the sum of all the elements in set2 exceeds 100.
 * If the sum exceeds 100, the function should break the loop and stop adding further elements.
 * If set1 is empty, the function should return an empty set.
 *
 * @param set1 First set containing elements to be added
 * @param set2 Second set to which elements are added
 * @return The updated set2 after adding elements from set1
 */
fun addElementsToSet(set1: Set<Int>, set2: MutableSet<Int>): MutableSet<Int> {

    // Iterate through each element in set1
    for (elem in set1) {
        // Check if the sum of elements in set2 is already greater than 100
        if (set2.sum() > 100) {
            break
        }
        // Add the element to set2
        set2.add(elem)
    }
    return set2
}
/**
 * The function takes two sets as input and adds elements from set1 to set2.
 * The function should only add elements from set1 to set2 until the sum of all the elements in set2 exceeds 100.
 * If the sum exceeds 100, the function should break the loop and stop adding further elements.
 * If set1 is empty, the function should return an empty set.
 *
 * @param set1 First set containing elements to be added
 * @param set2 Second set to which elements are added
 * @return The updated set2 after adding elements from set1
 */
fun addElementsToSet(set1: Set<Int>, set2: MutableSet<Int>): MutableSet<Int> {
/**
 * The function takes two sets as input and adds elements from set1 to set2.
 * The function should only add elements from set1 to set2 until the sum of all the elements in set2 exceeds 100.
 * If the sum exceeds 100, the function should break the loop and stop adding further elements.
 * If set1 is empty, the function should return an empty set.
 *
 * @param set1 First set containing elements to be added
 * @param set2 Second set to which elements are added
 * @return The updated set2 after adding elements from set1
 */
fun addElementsToSet(set1: Set<Int>, set2: MutableSet<Int>): MutableSet<Int> {

    // Iterate through each element in set1
    for (elem in set1) {
        // Check if the sum of elements in set2 is already greater than 100
        if (set2.sum() > 100) {
            break
        }
        // Add the element to set2
        set2.add(elem)
    }
    return set2
}