/**
 * Given a list of numbers and a threshold, delete all elements from the list that are greater than the threshold.
 *
 * @param numbers A list of numbers.
 * @param threshold The threshold value.
 * @return The updated list after deleting the elements.
 *
 * Example:
 * deleteElementsGreaterThan(listOf(10, 15, 20, 25, 30), 20) -> [10, 15, 20]
 */
fun deleteElementsGreaterThan(numbers: MutableList<Int>, threshold: Int): MutableList<Int> {

    val newList = numbers.toMutableList()  // Create a copy of the original list
    
    for (number in numbers.toList()) {
        if (number > threshold) {
            newList.remove(number)  // Remove the element if greater than threshold
        }
    }
    
    return newList
}
/**
 * Given a list of numbers and a threshold, delete all elements from the list that are greater than the threshold.
 *
 * @param numbers A list of numbers.
 * @param threshold The threshold value.
 * @return The updated list after deleting the elements.
 *
 * Example:
 * deleteElementsGreaterThan(listOf(10, 15, 20, 25, 30), 20) -> [10, 15, 20]
 */
fun deleteElementsGreaterThan(numbers: MutableList<Int>, threshold: Int): MutableList<Int> {
/**
 * Given a list of numbers and a threshold, delete all elements from the list that are greater than the threshold.
 *
 * @param numbers A list of numbers.
 * @param threshold The threshold value.
 * @return The updated list after deleting the elements.
 *
 * Example:
 * deleteElementsGreaterThan(listOf(10, 15, 20, 25, 30), 20) -> [10, 15, 20]
 */
fun deleteElementsGreaterThan(numbers: MutableList<Int>, threshold: Int): MutableList<Int> {

    val newList = numbers.toMutableList()  // Create a copy of the original list
    
    for (number in numbers.toList()) {
        if (number > threshold) {
            newList.remove(number)  // Remove the element if greater than threshold
        }
    }
    
    return newList
}