/**
 * You are working as a Machine Learning Engineer in Jina AI. Your task is to create a function that updates a given set
 * with another set using a for loop.
 *
 * Implement the function 'updateSetWithForLoop" that takes in two sets: 'originalSet" and 'updateSet`. The function
 * should update the 'originalSet" by adding all the elements from 'updateSet" using a for loop. The updated set should
 * then be returned.
 *
 * For example:
 * originalSet = setOf(1, 2, 3)
 * updateSet = setOf(4, 5)
 *
 * The expected output is:
 * setOf(1, 2, 3, 4, 5)
 *
 * Note:
 * - The function should not use any built-in set functions like 'union" or 'plus`.
 * - The function should not modify the 'updateSet" itself.
 * - The input sets may contain duplicate elements.
 * - The order of the elements in the resulting set does not matter.
 */
fun updateSetWithForLoop(originalSet: MutableSet<Int>, updateSet: Set<Int>): MutableSet<Int> {

    for (element in updateSet) {
        originalSet.add(element)
    }
    return originalSet
}
/**
 * You are working as a Machine Learning Engineer in Jina AI. Your task is to create a function that updates a given set
 * with another set using a for loop.
 *
 * Implement the function 'updateSetWithForLoop" that takes in two sets: 'originalSet" and 'updateSet`. The function
 * should update the 'originalSet" by adding all the elements from 'updateSet" using a for loop. The updated set should
 * then be returned.
 *
 * For example:
 * originalSet = setOf(1, 2, 3)
 * updateSet = setOf(4, 5)
 *
 * The expected output is:
 * setOf(1, 2, 3, 4, 5)
 *
 * Note:
 * - The function should not use any built-in set functions like 'union" or 'plus`.
 * - The function should not modify the 'updateSet" itself.
 * - The input sets may contain duplicate elements.
 * - The order of the elements in the resulting set does not matter.
 */
fun updateSetWithForLoop(originalSet: MutableSet<Int>, updateSet: Set<Int>): MutableSet<Int> {
/**
 * You are working as a Machine Learning Engineer in Jina AI. Your task is to create a function that updates a given set
 * with another set using a for loop.
 *
 * Implement the function 'updateSetWithForLoop" that takes in two sets: 'originalSet" and 'updateSet`. The function
 * should update the 'originalSet" by adding all the elements from 'updateSet" using a for loop. The updated set should
 * then be returned.
 *
 * For example:
 * originalSet = setOf(1, 2, 3)
 * updateSet = setOf(4, 5)
 *
 * The expected output is:
 * setOf(1, 2, 3, 4, 5)
 *
 * Note:
 * - The function should not use any built-in set functions like 'union" or 'plus`.
 * - The function should not modify the 'updateSet" itself.
 * - The input sets may contain duplicate elements.
 * - The order of the elements in the resulting set does not matter.
 */
fun updateSetWithForLoop(originalSet: MutableSet<Int>, updateSet: Set<Int>): MutableSet<Int> {

    for (element in updateSet) {
        originalSet.add(element)
    }
    return originalSet
}