Course of Raku / Addendum 🆕 / Flow and functions / Subroutines and functional style / Exercises

Sort by two keys

Problem

Given people as name/age pairs — Anna 30, Bob 25, Cara 30 — print them sorted by age, and by name within the same age.

Example

The program prints:

Bob (25)
Anna (30)
Cara (30)

Solution

See the solution

Course navigation

Solution: Describe by type   |   Solution: Sort by two keys