/**
 * This function removes all occurrences of the target element from the given list.
 *
 * @param lst The list containing elements.
 * @param target The element to be removed from the list.
 * @return The modified list without any occurrences of the target element.
 */
fun deleteElements(lst: MutableList<Int>, target: Int): List<Int> {

    for (index in lst.size - 1 downTo 0) {
        if (lst[index] == target) {
            lst.removeAt(index)
        }
    }
    return lst
}

// Example usage
/**
 * This function removes all occurrences of the target element from the given list.
 *
 * @param lst The list containing elements.
 * @param target The element to be removed from the list.
 * @return The modified list without any occurrences of the target element.
 */
fun deleteElements(lst: MutableList<Int>, target: Int): List<Int> {
/**
 * This function removes all occurrences of the target element from the given list.
 *
 * @param lst The list containing elements.
 * @param target The element to be removed from the list.
 * @return The modified list without any occurrences of the target element.
 */
fun deleteElements(lst: MutableList<Int>, target: Int): List<Int> {

    for (index in lst.size - 1 downTo 0) {
        if (lst[index] == target) {
            lst.removeAt(index)
        }
    }
    return lst
}

// Example usage