Course of Raku / Addendum 🆕 / Working with data / Lists, arrays, and hashes / Exercises

The second-largest value

Problem

From the list 3, 9, 4, 9, 1, 7 find the second-largest distinct value and print it. (The two 9s count as one, so the answer is 7.)

Example

The program prints:

7

Solution

See the solution

Course navigation

Lists, arrays, and hashes   |   Solution: The second-largest value