/**
 * This exercise requires appending new elements to a nested list within a nested loop.
 * The goal is to iterate over each element in lst1 and each element in lst2, append the sum of them to the nested list, and return the final updated nested list.
 *
 * @param lst1 The first list of elements.
 * @param lst2 The second list of elements.
 * @return The updated nested list after appending the sum of each pair of elements.
 */
fun appendLoopElements(lst1: List<Int>, lst2: List<Int>): List<List<Int>> {

    val nestedList = MutableList(lst1.size) { mutableListOf<Int>() }

    for (i in lst1.indices) {
        for (j in lst2.indices) {
            nestedList[i].add(lst1[i] + lst2[j])
        }
    }

    return nestedList
}
/**
 * This exercise requires appending new elements to a nested list within a nested loop.
 * The goal is to iterate over each element in lst1 and each element in lst2, append the sum of them to the nested list, and return the final updated nested list.
 *
 * @param lst1 The first list of elements.
 * @param lst2 The second list of elements.
 * @return The updated nested list after appending the sum of each pair of elements.
 */
fun appendLoopElements(lst1: List<Int>, lst2: List<Int>): List<List<Int>> {
/**
 * This exercise requires appending new elements to a nested list within a nested loop.
 * The goal is to iterate over each element in lst1 and each element in lst2, append the sum of them to the nested list, and return the final updated nested list.
 *
 * @param lst1 The first list of elements.
 * @param lst2 The second list of elements.
 * @return The updated nested list after appending the sum of each pair of elements.
 */
fun appendLoopElements(lst1: List<Int>, lst2: List<Int>): List<List<Int>> {

    val nestedList = MutableList(lst1.size) { mutableListOf<Int>() }

    for (i in lst1.indices) {
        for (j in lst2.indices) {
            nestedList[i].add(lst1[i] + lst2[j])
        }
    }

    return nestedList
}