Deviopath › Go

Sort People

Medium · Sorting

sort.Slice takes a less-function. Sort by age descending, then by name ascending when ages are equal.

Write SortPeople(names, ages) that returns the names in that order. The two slices are the same length.

Next: Make a Counter