/**
 * Given two sets 'set1' and 'set2', this function modifies the elements in 'set1' by adding the elements of 'set2' to it.
 * Additionally, it removes any duplicate elements from 'set1' and returns the modified set.
 *
 * @param set1 First set of elements
 * @param set2 Second set of elements
 * @return Modified set after adding 'set2' elements and removing duplicates
 */
fun modifyListElements(set1: MutableSet<Int>, set2: Set<Int>): MutableSet<Int> {

    // Loop through each element in set2
    for (element in set2) {
        // Check if the element is already present in set1
        if (element !in set1) {
            // If not present, add the element to set1
            set1.add(element)
        }
    }
    
    // Return the modified set1
    return set1
}
/**
 * Given two sets 'set1' and 'set2', this function modifies the elements in 'set1' by adding the elements of 'set2' to it.
 * Additionally, it removes any duplicate elements from 'set1' and returns the modified set.
 *
 * @param set1 First set of elements
 * @param set2 Second set of elements
 * @return Modified set after adding 'set2' elements and removing duplicates
 */
fun modifyListElements(set1: MutableSet<Int>, set2: Set<Int>): MutableSet<Int> {
/**
 * Given two sets 'set1' and 'set2', this function modifies the elements in 'set1' by adding the elements of 'set2' to it.
 * Additionally, it removes any duplicate elements from 'set1' and returns the modified set.
 *
 * @param set1 First set of elements
 * @param set2 Second set of elements
 * @return Modified set after adding 'set2' elements and removing duplicates
 */
fun modifyListElements(set1: MutableSet<Int>, set2: Set<Int>): MutableSet<Int> {

    // Loop through each element in set2
    for (element in set2) {
        // Check if the element is already present in set1
        if (element !in set1) {
            // If not present, add the element to set1
            set1.add(element)
        }
    }
    
    // Return the modified set1
    return set1
}