/**
 * Given a list of numbers, modify the value at the specified index with a new value.
 *
 * @param numbersList A list of numbers.
 * @param index The index at which to modify the value.
 * @param newValue The new value to replace at the specified index.
 * @return The modified list of numbers.
 */
fun modifyElements(numbersList: MutableList<Int>, index: Int, newValue: Int): List<Int> {

    if (index < 0 || index >= numbersList.size) {
        return listOf(-1) // Return a list with -1 to indicate an invalid index
    }
    
    numbersList[index] = newValue
    
    return numbersList
}
/**
 * Given a list of numbers, modify the value at the specified index with a new value.
 *
 * @param numbersList A list of numbers.
 * @param index The index at which to modify the value.
 * @param newValue The new value to replace at the specified index.
 * @return The modified list of numbers.
 */
fun modifyElements(numbersList: MutableList<Int>, index: Int, newValue: Int): List<Int> {
/**
 * Given a list of numbers, modify the value at the specified index with a new value.
 *
 * @param numbersList A list of numbers.
 * @param index The index at which to modify the value.
 * @param newValue The new value to replace at the specified index.
 * @return The modified list of numbers.
 */
fun modifyElements(numbersList: MutableList<Int>, index: Int, newValue: Int): List<Int> {

    if (index < 0 || index >= numbersList.size) {
        return listOf(-1) // Return a list with -1 to indicate an invalid index
    }
    
    numbersList[index] = newValue
    
    return numbersList
}