Input collection: myTestScores14
Name | Score |
Jennifer | 90 |
Robert | 60 |
Jaime | 70 |
Sarah | 100 |
Lynn | 85 |
Mike | 75 |
Steven | 45 |
Output collection: mySolution14
Name | Score |
Sarah | 100 |
Jennifer | 90 |
Lynn | 85 |
Solution code:
//Create a collection
ClearCollect(myTestScores14,
{Name: "Jennifer", Score: 90},
{Name: "Robert", Score: 60},
{Name: "Jaime", Score: 70},
{Name: "Sarah", Score: 100},
{Name: "Lynn", Score: 85},
{Name: "Mike", Score: 75},
{Name: "Steven", Score: 45}
);
//Get the highest scores code
ClearCollect(
mySolution14,
FirstN(Sort(myTestScores14,Score,Descending),3)
);