HI All,
Hopefully this is an easy question.
Given an unsorted list of numbers, I need to "drop" or disregard N
number of the highest numbers. Then I need to print the list in
original order and show which numbers were dropped.
for example, given:
def myList = [ 5, 2, 7, 9, 7, 3, 1 ]
def highNumbersToDrop = 2
// I need to...
myList.each() { thisItem ->
println thisItem
}
// having a result of something like:
5
2
7 - dropped
9 - dropped
7
3
1
My question is how to keep track of which numbers were "dropped" so
that when I display the list, I can add the " - dropped" text.
Thanks in advance,
Dan