/**
 * Takes a list and slices it from the given start to end index (inclusive),
 * and returns a new list containing the absolute values of the sliced elements.
 *
 * @param lst The input list
 * @param start The start index of the slice
 * @param end The end index of the slice
 * @return A new list with absolute values of the sliced elements
 */
fun sliceAndAbsolute(lst: List<Int>, start: Int, end: Int): List<Int> {

    // Slice the list using the given start and end indices
    val slicedList = lst.subList(start, end + 1)

    // Create a new list to store the absolute values
    val absList = mutableListOf<Int>()

    // Iterate over the slicedList
    for (num in slicedList) {
        // Check if the number is negative
        if (num < 0) {
            // Add the absolute value to absList
            absList.add(-num)
        } else {
            // Add the number itself to absList
            absList.add(num)
        }
    }

    // Return the list with absolute values
    return absList
}
/**
 * Takes a list and slices it from the given start to end index (inclusive),
 * and returns a new list containing the absolute values of the sliced elements.
 *
 * @param lst The input list
 * @param start The start index of the slice
 * @param end The end index of the slice
 * @return A new list with absolute values of the sliced elements
 */
fun sliceAndAbsolute(lst: List<Int>, start: Int, end: Int): List<Int> {
/**
 * Takes a list and slices it from the given start to end index (inclusive),
 * and returns a new list containing the absolute values of the sliced elements.
 *
 * @param lst The input list
 * @param start The start index of the slice
 * @param end The end index of the slice
 * @return A new list with absolute values of the sliced elements
 */
fun sliceAndAbsolute(lst: List<Int>, start: Int, end: Int): List<Int> {

    // Slice the list using the given start and end indices
    val slicedList = lst.subList(start, end + 1)

    // Create a new list to store the absolute values
    val absList = mutableListOf<Int>()

    // Iterate over the slicedList
    for (num in slicedList) {
        // Check if the number is negative
        if (num < 0) {
            // Add the absolute value to absList
            absList.add(-num)
        } else {
            // Add the number itself to absList
            absList.add(num)
        }
    }

    // Return the list with absolute values
    return absList
}