/**
 * Given a tuple 'tup', modify the element at a specific 'index' with the provided 'value'.
 *
 * @param tup The input tuple.
 * @param index The index at which the element needs to be modified.
 * @param value The value to be set at the specified 'index' in the tuple.
 * @return The updated tuple with the element at the 'index' modified to 'value'.
 *
 * Example:
 * updateTuple(listOf(1, 2, 3, 4, 5), 2, "hello") // [1, 2, "hello", 4, 5]
 */
fun updateTuple(tup: List<Any>, index: Int, value: Any): List<Any> {

    // Convert the tuple to a mutable list to modify the element
    val mutableList = tup.toMutableList()
    mutableList[index] = value
    // Return the modified list
    return mutableList
}
/**
 * Given a tuple 'tup', modify the element at a specific 'index' with the provided 'value'.
 *
 * @param tup The input tuple.
 * @param index The index at which the element needs to be modified.
 * @param value The value to be set at the specified 'index' in the tuple.
 * @return The updated tuple with the element at the 'index' modified to 'value'.
 *
 * Example:
 * updateTuple(listOf(1, 2, 3, 4, 5), 2, "hello") // [1, 2, "hello", 4, 5]
 */
fun updateTuple(tup: List<Any>, index: Int, value: Any): List<Any> {
/**
 * Given a tuple 'tup', modify the element at a specific 'index' with the provided 'value'.
 *
 * @param tup The input tuple.
 * @param index The index at which the element needs to be modified.
 * @param value The value to be set at the specified 'index' in the tuple.
 * @return The updated tuple with the element at the 'index' modified to 'value'.
 *
 * Example:
 * updateTuple(listOf(1, 2, 3, 4, 5), 2, "hello") // [1, 2, "hello", 4, 5]
 */
fun updateTuple(tup: List<Any>, index: Int, value: Any): List<Any> {

    // Convert the tuple to a mutable list to modify the element
    val mutableList = tup.toMutableList()
    mutableList[index] = value
    // Return the modified list
    return mutableList
}