Sort Array by Moving Items to an Empty Cache Slot
A cache has `n` slots labeled `0` through `n - 1`. Slot `0` is the empty slot, and every other slot contains exactly one item whose label is also between `0` and `n - 1`. The array `slots` describes the current state: `slots[i]` is the item currently in slot `i`, and `slots[i] == 0` identifies the empty slot.