/**
 * This function deletes specified elements from an array.
 *
 * @param arr The array from which elements need to be deleted.
 * @param toDelete The elements to be deleted from the array.
 * @return The updated array with specified elements removed.
 */
fun deleteElements(arr: MutableList<Int>, toDelete: List<Int>): List<Int> {

    for (element in toDelete) {
        while (element in arr) {
            arr.remove(element)
        }
    }
    return arr
}

// Example usage
/**
 * This function deletes specified elements from an array.
 *
 * @param arr The array from which elements need to be deleted.
 * @param toDelete The elements to be deleted from the array.
 * @return The updated array with specified elements removed.
 */
fun deleteElements(arr: MutableList<Int>, toDelete: List<Int>): List<Int> {
/**
 * This function deletes specified elements from an array.
 *
 * @param arr The array from which elements need to be deleted.
 * @param toDelete The elements to be deleted from the array.
 * @return The updated array with specified elements removed.
 */
fun deleteElements(arr: MutableList<Int>, toDelete: List<Int>): List<Int> {

    for (element in toDelete) {
        while (element in arr) {
            arr.remove(element)
        }
    }
    return arr
}

// Example usage