/**
 * Given a list of numbers and a threshold, remove all numbers in the list that are greater than the threshold.
 *
 * @param numbers A list of numbers.
 * @param threshold The threshold number.
 * @return The modified list with numbers smaller or equal to the threshold.
 */
fun removeGreaterNumbers(numbers: MutableList<Int>, threshold: Int): MutableList<Int> {

    val iterator = numbers.listIterator()
    while (iterator.hasNext()) {
        if (iterator.next() > threshold) {
            iterator.remove()
        }
    }
    return numbers
}
/**
 * Given a list of numbers and a threshold, remove all numbers in the list that are greater than the threshold.
 *
 * @param numbers A list of numbers.
 * @param threshold The threshold number.
 * @return The modified list with numbers smaller or equal to the threshold.
 */
fun removeGreaterNumbers(numbers: MutableList<Int>, threshold: Int): MutableList<Int> {
/**
 * Given a list of numbers and a threshold, remove all numbers in the list that are greater than the threshold.
 *
 * @param numbers A list of numbers.
 * @param threshold The threshold number.
 * @return The modified list with numbers smaller or equal to the threshold.
 */
fun removeGreaterNumbers(numbers: MutableList<Int>, threshold: Int): MutableList<Int> {

    val iterator = numbers.listIterator()
    while (iterator.hasNext()) {
        if (iterator.next() > threshold) {
            iterator.remove()
        }
    }
    return numbers
}