In this challenge, you are going to be attempting to sort a list of Flight
s based on their price from highest to lowest.
You will have to implement the SortByPrice
function that takes in a slice of type Flight
and returns the sorted list of Flights.
In order to help you see what is going on, you have been provided a very quick printFlights function which you can use to print the flights out.
Helpful Article
See the Solution
Feel free to have a look at the forum discussion thread for this challenge and contribute with your own solutions here - Challenge 03 - Sort By Price
Further Reading:
If you like this challenge then you may also appreciate some of the following articles on the site: