/**
 * Given a list and an element, removes all occurrences of the element from the list.
 *
 * @param list The list to be modified.
 * @param element The element to be removed from the list.
 * @return The modified list with all occurrences of the element removed.
 */
fun removeElementFromList(list: MutableList<Any>, element: Any): List<Any> {

    var i = 0
    while (i < list.size) {
        if (list[i] == element) {
            list.removeAt(i)
        } else {
            i++
        }
    }
    return list
}
/**
 * Given a list and an element, removes all occurrences of the element from the list.
 *
 * @param list The list to be modified.
 * @param element The element to be removed from the list.
 * @return The modified list with all occurrences of the element removed.
 */
fun removeElementFromList(list: MutableList<Any>, element: Any): List<Any> {
/**
 * Given a list and an element, removes all occurrences of the element from the list.
 *
 * @param list The list to be modified.
 * @param element The element to be removed from the list.
 * @return The modified list with all occurrences of the element removed.
 */
fun removeElementFromList(list: MutableList<Any>, element: Any): List<Any> {

    var i = 0
    while (i < list.size) {
        if (list[i] == element) {
            list.removeAt(i)
        } else {
            i++
        }
    }
    return list
}