/**
 * Create a tuple using parentheses and modify an element using list methods.
 *
 * In this exercise, you need to create a tuple using parentheses and modify a specific element
 * within that tuple using list methods.
 *
 * @param elements The original tuple of elements.
 * @param index The index of the element to be modified.
 * @param newElement The new element to replace the old one at the given index.
 * @return The modified tuple.
 *
 * Example:
 * originalTuple = listOf(10, 20, 30, 40, 50)
 * createModifiedTuple(originalTuple, 2, 35) // Output: (10, 20, 35, 40, 50)
 */
fun createModifiedTuple(elements: List<Int>, index: Int, newElement: Int): List<Int> {

    // Convert the list to a mutable list
    val modifiedList = elements.toMutableList()

    // Modify the element at the given index
    modifiedList[index] = newElement

    return modifiedList
}
/**
 * Create a tuple using parentheses and modify an element using list methods.
 *
 * In this exercise, you need to create a tuple using parentheses and modify a specific element
 * within that tuple using list methods.
 *
 * @param elements The original tuple of elements.
 * @param index The index of the element to be modified.
 * @param newElement The new element to replace the old one at the given index.
 * @return The modified tuple.
 *
 * Example:
 * originalTuple = listOf(10, 20, 30, 40, 50)
 * createModifiedTuple(originalTuple, 2, 35) // Output: (10, 20, 35, 40, 50)
 */
fun createModifiedTuple(elements: List<Int>, index: Int, newElement: Int): List<Int> {
/**
 * Create a tuple using parentheses and modify an element using list methods.
 *
 * In this exercise, you need to create a tuple using parentheses and modify a specific element
 * within that tuple using list methods.
 *
 * @param elements The original tuple of elements.
 * @param index The index of the element to be modified.
 * @param newElement The new element to replace the old one at the given index.
 * @return The modified tuple.
 *
 * Example:
 * originalTuple = listOf(10, 20, 30, 40, 50)
 * createModifiedTuple(originalTuple, 2, 35) // Output: (10, 20, 35, 40, 50)
 */
fun createModifiedTuple(elements: List<Int>, index: Int, newElement: Int): List<Int> {

    // Convert the list to a mutable list
    val modifiedList = elements.toMutableList()

    // Modify the element at the given index
    modifiedList[index] = newElement

    return modifiedList
}