ncsort.go — the skeleton
Create ncsort.go (see the panel). Six signatures, and one requirement differs
from every earlier lesson.
cmp.Hit() — not once
Until now the counters measured how many comparisons. Here the test demands exactly zero.
The cmp parameter is still there — so the signature matches the other sorts,
and so the test can prove the count is zero. If a cmp.Hit() appears anywhere,
it has stopped being a counting sort.
moves.Hit() stays: one per element written into the output.
What the test checks
CountingSortByRating— correct order, 0 comparisons, exactly n moves, and stability;RadixSortByYear— correct order, 0 comparisons;RadixSortByYearUnstable— must fail to sort, and must do the same amount of work as the stable version.
That last one is unusual: you are writing a function that has to be wrong. It is broken deliberately, by one loop direction, and step 7 shows what for.
The bounds you already have
CountingSortByRating uses MinRating and MaxRating from item.go — the
constants you wrote in lesson 1. yearDigit and countingPass work on Year.
Nothing new needs adding. The assumption this lesson depends on has been in your data type for eight lessons.