/**
 * Given a list [lst], an index [index], and a value [value], modify the element at the specified index with the given value, and return the modified list.
 *
 * @param lst The original list.
 * @param index The index of the element to be modified.
 * @param value The value to be assigned to the specified index.
 * @return The modified list with the element at the specified index modified.
 *
 * Examples:
 * modifyList(listOf(1, 2, 3, 4, 5), 2, "Modified")
 * >> [1, 2, "Modified", 4, 5]
 *
 * modifyList(listOf("apple", "banana", "cherry"), 1, "orange")
 * >> ["apple", "orange", "cherry"]
 *
 * modifyList(listOf("a", "b", "c"), 0, true)
 * >> [true, "b", "c"]
 */
fun modifyList(lst: MutableList<Any>, index: Int, value: Any): List<Any> {

    // Assign the value to the specified index in the list
    lst[index] = value
    return lst
}
/**
 * Given a list [lst], an index [index], and a value [value], modify the element at the specified index with the given value, and return the modified list.
 *
 * @param lst The original list.
 * @param index The index of the element to be modified.
 * @param value The value to be assigned to the specified index.
 * @return The modified list with the element at the specified index modified.
 *
 * Examples:
 * modifyList(listOf(1, 2, 3, 4, 5), 2, "Modified")
 * >> [1, 2, "Modified", 4, 5]
 *
 * modifyList(listOf("apple", "banana", "cherry"), 1, "orange")
 * >> ["apple", "orange", "cherry"]
 *
 * modifyList(listOf("a", "b", "c"), 0, true)
 * >> [true, "b", "c"]
 */
fun modifyList(lst: MutableList<Any>, index: Int, value: Any): List<Any> {
/**
 * Given a list [lst], an index [index], and a value [value], modify the element at the specified index with the given value, and return the modified list.
 *
 * @param lst The original list.
 * @param index The index of the element to be modified.
 * @param value The value to be assigned to the specified index.
 * @return The modified list with the element at the specified index modified.
 *
 * Examples:
 * modifyList(listOf(1, 2, 3, 4, 5), 2, "Modified")
 * >> [1, 2, "Modified", 4, 5]
 *
 * modifyList(listOf("apple", "banana", "cherry"), 1, "orange")
 * >> ["apple", "orange", "cherry"]
 *
 * modifyList(listOf("a", "b", "c"), 0, true)
 * >> [true, "b", "c"]
 */
fun modifyList(lst: MutableList<Any>, index: Int, value: Any): List<Any> {

    // Assign the value to the specified index in the list
    lst[index] = value
    return lst
}