/**
 * Given a list of elements, an index, and a new value, modify the element at the given index with the new value.
 *
 * @param elements A list of elements.
 * @param index The index at which to modify the element.
 * @param newValue The new value to be assigned to the element at the given index.
 * @return The modified list with the element at the specified index changed to the new value.
 *
 * Example:
 * modifyElementsSocialWorker(listOf("apple", "banana", "carrot"), 1, "orange") // Output: ["apple", "orange", "carrot"]
 */
fun modifyElementsSocialWorker(elements: MutableList<String>, index: Int, newValue: String): List<String> {

    val modifiedList = elements.toMutableList()
    modifiedList[index] = newValue
    return modifiedList
}
/**
 * Given a list of elements, an index, and a new value, modify the element at the given index with the new value.
 *
 * @param elements A list of elements.
 * @param index The index at which to modify the element.
 * @param newValue The new value to be assigned to the element at the given index.
 * @return The modified list with the element at the specified index changed to the new value.
 *
 * Example:
 * modifyElementsSocialWorker(listOf("apple", "banana", "carrot"), 1, "orange") // Output: ["apple", "orange", "carrot"]
 */
fun modifyElementsSocialWorker(elements: MutableList<String>, index: Int, newValue: String): List<String> {
/**
 * Given a list of elements, an index, and a new value, modify the element at the given index with the new value.
 *
 * @param elements A list of elements.
 * @param index The index at which to modify the element.
 * @param newValue The new value to be assigned to the element at the given index.
 * @return The modified list with the element at the specified index changed to the new value.
 *
 * Example:
 * modifyElementsSocialWorker(listOf("apple", "banana", "carrot"), 1, "orange") // Output: ["apple", "orange", "carrot"]
 */
fun modifyElementsSocialWorker(elements: MutableList<String>, index: Int, newValue: String): List<String> {

    val modifiedList = elements.toMutableList()
    modifiedList[index] = newValue
    return modifiedList
}