/**
 * You are given two lists lst1 and lst2, and a number num.
 * Your task is to add num elements to lst1 from lst2 using a loop.
 * You can only modify lst1 and cannot modify lst2.
 *
 * Write a Kotlin code to solve the exercise.
 */
fun addElements(lst1: MutableList<Int>, lst2: List<Int>, num: Int): MutableList<Int> {

    // Initializing index variable for lst2 and num_count variable
    var index = 0
    var numCount = 0

    // Loop to add elements to lst1 from lst2
    while (numCount < num) {
        lst1.add(lst2[index])
        index++
        numCount++
    }

    return lst1
}
/**
 * You are given two lists lst1 and lst2, and a number num.
 * Your task is to add num elements to lst1 from lst2 using a loop.
 * You can only modify lst1 and cannot modify lst2.
 *
 * Write a Kotlin code to solve the exercise.
 */
fun addElements(lst1: MutableList<Int>, lst2: List<Int>, num: Int): MutableList<Int> {
/**
 * You are given two lists lst1 and lst2, and a number num.
 * Your task is to add num elements to lst1 from lst2 using a loop.
 * You can only modify lst1 and cannot modify lst2.
 *
 * Write a Kotlin code to solve the exercise.
 */
fun addElements(lst1: MutableList<Int>, lst2: List<Int>, num: Int): MutableList<Int> {

    // Initializing index variable for lst2 and num_count variable
    var index = 0
    var numCount = 0

    // Loop to add elements to lst1 from lst2
    while (numCount < num) {
        lst1.add(lst2[index])
        index++
        numCount++
    }

    return lst1
}