/**
 * Given a list of numbers, this function should append 10 random elements
 * to the end of the list and then create three sublists from the original list
 * using different slicing techniques.
 *
 * @param nums A list of numbers.
 * @return A list containing the original list with the appended elements and three sublists.
 */
import kotlin.random.Random


fun appendElementsAndSliceList(nums: MutableList<Int>): List<List<Int>> {

    // Append 10 random elements to the end of the list
    repeat(10) {
        nums.add(Random.nextInt(1, 101))
    }

    // Create three sublists
    val sublist1 = nums.subList(3, 7)  // Extract elements from index 3 to 6
    val sublist2 = nums.filterIndexed { index, _ -> index % 2 == 1 }  // Extract elements starting from index 1 with a step of 2
    val sublist3 = nums.reversed()  // Reverse the entire list

    return listOf(nums, sublist1, sublist2, sublist3)
}
import kotlin.random.Random

/**
 * Given a list of numbers, this function should append 10 random elements
 * to the end of the list and then create three sublists from the original list
 * using different slicing techniques.
 *
 * @param nums A list of numbers.
 * @return A list containing the original list with the appended elements and three sublists.
 */
fun appendElementsAndSliceList(nums: MutableList<Int>): List<List<Int>> {
import kotlin.random.Random

/**
 * Given a list of numbers, this function should append 10 random elements
 * to the end of the list and then create three sublists from the original list
 * using different slicing techniques.
 *
 * @param nums A list of numbers.
 * @return A list containing the original list with the appended elements and three sublists.
 */
fun appendElementsAndSliceList(nums: MutableList<Int>): List<List<Int>> {

    // Append 10 random elements to the end of the list
    repeat(10) {
        nums.add(Random.nextInt(1, 101))
    }

    // Create three sublists
    val sublist1 = nums.subList(3, 7)  // Extract elements from index 3 to 6
    val sublist2 = nums.filterIndexed { index, _ -> index % 2 == 1 }  // Extract elements starting from index 1 with a step of 2
    val sublist3 = nums.reversed()  // Reverse the entire list

    return listOf(nums, sublist1, sublist2, sublist3)
}