/**
 * In biomedical engineering, it is often necessary to access and modify specific elements within a tuple.
 * This exercise focuses on accessing tuple elements and changing them. Your task is to complete the function
 * 'accessAndChangeElements' which takes a tuple, an index value, and a new value as input. The function should
 * modify the tuple by replacing the element at the given index with the new value and return the updated tuple.
 *
 * For example:
 * accessAndChangeElements(listOf("Temperature", "Pressure", "Heart Rate"), 1, "Oxygen Saturation") should return
 * listOf("Temperature", "Oxygen Saturation", "Heart Rate")
 */
fun accessAndChangeElements(tup: List<String>, index: Int, newValue: String): List<String> {

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

    // Access the element at the specified index and change it to the new value
    modifiedList[index] = newValue

    return modifiedList
}
/**
 * In biomedical engineering, it is often necessary to access and modify specific elements within a tuple.
 * This exercise focuses on accessing tuple elements and changing them. Your task is to complete the function
 * 'accessAndChangeElements' which takes a tuple, an index value, and a new value as input. The function should
 * modify the tuple by replacing the element at the given index with the new value and return the updated tuple.
 *
 * For example:
 * accessAndChangeElements(listOf("Temperature", "Pressure", "Heart Rate"), 1, "Oxygen Saturation") should return
 * listOf("Temperature", "Oxygen Saturation", "Heart Rate")
 */
fun accessAndChangeElements(tup: List<String>, index: Int, newValue: String): List<String> {
/**
 * In biomedical engineering, it is often necessary to access and modify specific elements within a tuple.
 * This exercise focuses on accessing tuple elements and changing them. Your task is to complete the function
 * 'accessAndChangeElements' which takes a tuple, an index value, and a new value as input. The function should
 * modify the tuple by replacing the element at the given index with the new value and return the updated tuple.
 *
 * For example:
 * accessAndChangeElements(listOf("Temperature", "Pressure", "Heart Rate"), 1, "Oxygen Saturation") should return
 * listOf("Temperature", "Oxygen Saturation", "Heart Rate")
 */
fun accessAndChangeElements(tup: List<String>, index: Int, newValue: String): List<String> {

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

    // Access the element at the specified index and change it to the new value
    modifiedList[index] = newValue

    return modifiedList
}