/**
 * In this exercise, you need to complete the code to append new elements to the given list and format the resulting string.
 *
 * @param list1 The initial list.
 * @param string1 The string to format using the list elements.
 * @return The formatted string.
 */
fun appendAndFormat(list1: MutableList<Int>, string1: String): String {

    // Append the numbers [1, 2, 3] to the given list
    list1.addAll(listOf(1, 2, 3))

    // Format the string with the first three elements of the list
    val formattedString = string1.format(list1[0], list1[1], list1[2])

    return formattedString
}
/**
 * In this exercise, you need to complete the code to append new elements to the given list and format the resulting string.
 *
 * @param list1 The initial list.
 * @param string1 The string to format using the list elements.
 * @return The formatted string.
 */
fun appendAndFormat(list1: MutableList<Int>, string1: String): String {
/**
 * In this exercise, you need to complete the code to append new elements to the given list and format the resulting string.
 *
 * @param list1 The initial list.
 * @param string1 The string to format using the list elements.
 * @return The formatted string.
 */
fun appendAndFormat(list1: MutableList<Int>, string1: String): String {

    // Append the numbers [1, 2, 3] to the given list
    list1.addAll(listOf(1, 2, 3))

    // Format the string with the first three elements of the list
    val formattedString = string1.format(list1[0], list1[1], list1[2])

    return formattedString
}