/**
 * This function replaces all occurrences of a specific element in a list with a new element.
 *
 * @param data A list containing data elements.
 * @param oldElement The element to be replaced.
 * @param newElement The new element to replace the old element with.
 * @return The modified list with replaced elements.
 */
fun replaceElements(data: MutableList<Any>, oldElement: Any, newElement: Any): List<Any> {

    for (i in data.indices) {
        if (data[i] == oldElement) {
            data[i] = newElement
        }
    }
    return data
}
/**
 * This function replaces all occurrences of a specific element in a list with a new element.
 *
 * @param data A list containing data elements.
 * @param oldElement The element to be replaced.
 * @param newElement The new element to replace the old element with.
 * @return The modified list with replaced elements.
 */
fun replaceElements(data: MutableList<Any>, oldElement: Any, newElement: Any): List<Any> {
/**
 * This function replaces all occurrences of a specific element in a list with a new element.
 *
 * @param data A list containing data elements.
 * @param oldElement The element to be replaced.
 * @param newElement The new element to replace the old element with.
 * @return The modified list with replaced elements.
 */
fun replaceElements(data: MutableList<Any>, oldElement: Any, newElement: Any): List<Any> {

    for (i in data.indices) {
        if (data[i] == oldElement) {
            data[i] = newElement
        }
    }
    return data
}