/**
 * Given a list of integers and an index, modify the elements in the list by slicing and incrementing each element by 1.
 *
 * @param lst A list of integers
 * @param index An index indicating the starting position for modifying elements
 * @return The modified list
 *
 * Example:
 * modifyListElements(listOf(1, 2, 3, 4, 5), 2) -> [1, 2, 4, 5, 6]
 */
fun modifyListElements(lst: MutableList<Int>, index: Int): List<Int> {

    // Slice the list starting from the specified index
    val slicedList = lst.subList(index, lst.size)

    // Increment each element in the sliced list by 1
    val modifiedList = slicedList.map { it + 1 }

    // Replace the modified portion in the original list
    lst.subList(index, lst.size).clear()
    lst.addAll(modifiedList)

    // Return the modified list
    return lst
}
/**
 * Given a list of integers and an index, modify the elements in the list by slicing and incrementing each element by 1.
 *
 * @param lst A list of integers
 * @param index An index indicating the starting position for modifying elements
 * @return The modified list
 *
 * Example:
 * modifyListElements(listOf(1, 2, 3, 4, 5), 2) -> [1, 2, 4, 5, 6]
 */
fun modifyListElements(lst: MutableList<Int>, index: Int): List<Int> {
/**
 * Given a list of integers and an index, modify the elements in the list by slicing and incrementing each element by 1.
 *
 * @param lst A list of integers
 * @param index An index indicating the starting position for modifying elements
 * @return The modified list
 *
 * Example:
 * modifyListElements(listOf(1, 2, 3, 4, 5), 2) -> [1, 2, 4, 5, 6]
 */
fun modifyListElements(lst: MutableList<Int>, index: Int): List<Int> {

    // Slice the list starting from the specified index
    val slicedList = lst.subList(index, lst.size)

    // Increment each element in the sliced list by 1
    val modifiedList = slicedList.map { it + 1 }

    // Replace the modified portion in the original list
    lst.subList(index, lst.size).clear()
    lst.addAll(modifiedList)

    // Return the modified list
    return lst
}