/**
 * Given a list of numbers and two index positions,
 * slice the list from the given start index to the end index,
 * and then append the elements of that slice at the end of the list.
 *
 * @param numbers A list of numbers.
 * @param start An integer indicating the start index position.
 * @param end An integer indicating the end index position.
 * @return The modified list with the slice elements added at the end.
 */
fun sliceAndAdd(numbers: MutableList<Int>, start: Int, end: Int): List<Int> {

    // Slice the list from the start index to the end index
    val sliced = numbers.subList(start, end + 1)

    // Add the slice elements at the end of the list
    numbers.addAll(sliced)

    return numbers
}
/**
 * Given a list of numbers and two index positions,
 * slice the list from the given start index to the end index,
 * and then append the elements of that slice at the end of the list.
 *
 * @param numbers A list of numbers.
 * @param start An integer indicating the start index position.
 * @param end An integer indicating the end index position.
 * @return The modified list with the slice elements added at the end.
 */
fun sliceAndAdd(numbers: MutableList<Int>, start: Int, end: Int): List<Int> {
/**
 * Given a list of numbers and two index positions,
 * slice the list from the given start index to the end index,
 * and then append the elements of that slice at the end of the list.
 *
 * @param numbers A list of numbers.
 * @param start An integer indicating the start index position.
 * @param end An integer indicating the end index position.
 * @return The modified list with the slice elements added at the end.
 */
fun sliceAndAdd(numbers: MutableList<Int>, start: Int, end: Int): List<Int> {

    // Slice the list from the start index to the end index
    val sliced = numbers.subList(start, end + 1)

    // Add the slice elements at the end of the list
    numbers.addAll(sliced)

    return numbers
}