/**
 * Given a list of numbers 'nums' and a list of new elements 'elements', use the addition assignment operator to
 * add all the elements from 'elements' to 'nums'. Return the updated 'nums' list.
 *
 * @param nums A list of numbers.
 * @param elements A list of elements to be added to 'nums'.
 * @return Updated 'nums' list with elements added.
 *
 * Example:
 * addElementsToList(listOf(1, 2, 3), listOf(4, 5, 6)) => [1, 2, 3, 4, 5, 6]
 * addElementsToList(listOf(10, 20), listOf(30, 40, 50)) => [10, 20, 30, 40, 50]
 */
fun addElementsToList(nums: MutableList<Int>, elements: List<Int>): List<Int> {

    // Iterate through each element in 'elements'
    for (element in elements) {
        // Use addition assignment operator to add 'element' to 'nums'
        nums += element
    }
    return nums
}
/**
 * Given a list of numbers 'nums' and a list of new elements 'elements', use the addition assignment operator to
 * add all the elements from 'elements' to 'nums'. Return the updated 'nums' list.
 *
 * @param nums A list of numbers.
 * @param elements A list of elements to be added to 'nums'.
 * @return Updated 'nums' list with elements added.
 *
 * Example:
 * addElementsToList(listOf(1, 2, 3), listOf(4, 5, 6)) => [1, 2, 3, 4, 5, 6]
 * addElementsToList(listOf(10, 20), listOf(30, 40, 50)) => [10, 20, 30, 40, 50]
 */
fun addElementsToList(nums: MutableList<Int>, elements: List<Int>): List<Int> {
/**
 * Given a list of numbers 'nums' and a list of new elements 'elements', use the addition assignment operator to
 * add all the elements from 'elements' to 'nums'. Return the updated 'nums' list.
 *
 * @param nums A list of numbers.
 * @param elements A list of elements to be added to 'nums'.
 * @return Updated 'nums' list with elements added.
 *
 * Example:
 * addElementsToList(listOf(1, 2, 3), listOf(4, 5, 6)) => [1, 2, 3, 4, 5, 6]
 * addElementsToList(listOf(10, 20), listOf(30, 40, 50)) => [10, 20, 30, 40, 50]
 */
fun addElementsToList(nums: MutableList<Int>, elements: List<Int>): List<Int> {

    // Iterate through each element in 'elements'
    for (element in elements) {
        // Use addition assignment operator to add 'element' to 'nums'
        nums += element
    }
    return nums
}