[copied from GT FB group] I am looking to compare 5 numbers and output the 1st and the 2nd highest! What is the best way to go about this?
What if I'm trying to output a 1st and 2nd highest, and there's a tie in myCollection.sort ie myCollection[1] = 3, myCollection[2] = 3, myCollection[3] = 1
What's the best way to output both 1st highest, and 2nd highest?
https://www.guidedtrack.com/programs/53nnjta/run
Put them in a collection and use myCollection.sort(“decreasing”)
myCollection.sort(“decreasing”)
Then do myCollection[1] and myCollection[2]
myCollection[1]
myCollection[2]
>> myCollection.sort(“decreasing”) >> first = myCollection[1] >> second = myCollection[2] *if: first = second >> second = myCollection[3]