Exercise: Sorting and Iterating
Let's test how to sort and iterate vectors.
We'll cover the following
This exercise is all about sorting lists and using iterators to extract data from them.
Problem statement
Given a list of numbers, you need to:
- Sort the numbers.
- Print the second number in the sorted list.
- Print the first number in the sorted list.
- Print the last number in the sorted list.
The list of numbers for you to work with is provided.
Coding challenge
Everything you need is in the Deeper Dungeons chapter. We encourage you to try solving it yourself before looking at the solution.
Get hands-on with 1400+ tech skills courses.