/**
 * Your fashion designer friend wants your help with modifying elements of a list which is actually a tuple
 * containing information about the fashion collection for an upcoming show. You need to write a function that
 * takes in a tuple and an index, and returns a new tuple with the element at the given index modified.
 *
 * @param tup A tuple representing the fashion collection information
 * @param index An integer indicating the index of the element to be modified
 * @return A new tuple with the modified element
 *
 * Example:
 * modifyTuple(listOf("Dress", "Blouse", "Skirt"), 2) -> listOf("Dress", "Blouse", "Pants")
 *
 * Note:
 * Tuples are immutable, so we need to convert the tuple to a list, modify the element, and then convert it back to a tuple.
 */
fun modifyTuple(tup: List<String>, index: Int): List<String> {

    val modifiedList = tup.toMutableList()  // Convert tuple to list
    modifiedList[index] = "Pants"  // Modify the element at the given index
    return modifiedList  // Return the modified list
}
/**
 * Your fashion designer friend wants your help with modifying elements of a list which is actually a tuple
 * containing information about the fashion collection for an upcoming show. You need to write a function that
 * takes in a tuple and an index, and returns a new tuple with the element at the given index modified.
 *
 * @param tup A tuple representing the fashion collection information
 * @param index An integer indicating the index of the element to be modified
 * @return A new tuple with the modified element
 *
 * Example:
 * modifyTuple(listOf("Dress", "Blouse", "Skirt"), 2) -> listOf("Dress", "Blouse", "Pants")
 *
 * Note:
 * Tuples are immutable, so we need to convert the tuple to a list, modify the element, and then convert it back to a tuple.
 */
fun modifyTuple(tup: List<String>, index: Int): List<String> {
/**
 * Your fashion designer friend wants your help with modifying elements of a list which is actually a tuple
 * containing information about the fashion collection for an upcoming show. You need to write a function that
 * takes in a tuple and an index, and returns a new tuple with the element at the given index modified.
 *
 * @param tup A tuple representing the fashion collection information
 * @param index An integer indicating the index of the element to be modified
 * @return A new tuple with the modified element
 *
 * Example:
 * modifyTuple(listOf("Dress", "Blouse", "Skirt"), 2) -> listOf("Dress", "Blouse", "Pants")
 *
 * Note:
 * Tuples are immutable, so we need to convert the tuple to a list, modify the element, and then convert it back to a tuple.
 */
fun modifyTuple(tup: List<String>, index: Int): List<String> {

    val modifiedList = tup.toMutableList()  // Convert tuple to list
    modifiedList[index] = "Pants"  // Modify the element at the given index
    return modifiedList  // Return the modified list
}