/**
 * Given a tuple (tup), an index, and a value, modify the tuple by replacing the element at the specified index with the given value.
 *
 * @param tup The original tuple.
 * @param index The index of the element to be replaced.
 * @param value The value to replace the element at the specified index.
 * @return The updated tuple.
 */
fun updateTuple(tup: List<Any>, index: Int, value: Any): List<Any> {

    val updatedList = tup.toMutableList()
    updatedList[index] = value
    return updatedList
}
/**
 * Given a tuple (tup), an index, and a value, modify the tuple by replacing the element at the specified index with the given value.
 *
 * @param tup The original tuple.
 * @param index The index of the element to be replaced.
 * @param value The value to replace the element at the specified index.
 * @return The updated tuple.
 */
fun updateTuple(tup: List<Any>, index: Int, value: Any): List<Any> {
/**
 * Given a tuple (tup), an index, and a value, modify the tuple by replacing the element at the specified index with the given value.
 *
 * @param tup The original tuple.
 * @param index The index of the element to be replaced.
 * @param value The value to replace the element at the specified index.
 * @return The updated tuple.
 */
fun updateTuple(tup: List<Any>, index: Int, value: Any): List<Any> {

    val updatedList = tup.toMutableList()
    updatedList[index] = value
    return updatedList
}